PandA-2024.02
|
Functor used to compute size of memory objects. More...
#include <compute_reserved_memory.hpp>
Public Member Functions | |
ComputeReservedMemory (const tree_managerConstRef TM, const tree_nodeConstRef tn) | |
Constructor. More... | |
unsigned long long | GetReservedBytes () const |
Return the computed value. More... | |
void | CheckEnd () override |
Check that all the necessary information was present in the initialization string. More... | |
void | GoDown () override |
Start the initialization of a new aggregated data structure. More... | |
void | GoNext () override |
Consume an element of an aggregated data structure. More... | |
void | GoUp () override |
Ends the initialization of the current aggregated data structure. More... | |
void | Process (const std::string &content) override |
Process an element. More... | |
void | ActivateFileInit (const std::string &) override |
In this case the function does not activate anything. More... | |
void | FinalizeFileInit () override |
do nothing More... | |
Public Member Functions inherited from CInitializationParserFunctor | |
CInitializationParserFunctor () | |
Constructor. More... | |
virtual | ~CInitializationParserFunctor () |
Destructor. More... | |
Private Attributes | |
const tree_managerConstRef | TM |
The tree manager. More... | |
const tree_nodeConstRef | tn |
The tree node to be stored in memory. More... | |
unsigned int | elements_number |
The number of elements in the top level. More... | |
unsigned int | depth_level |
The current level of {}. More... | |
Additional Inherited Members | |
Protected Attributes inherited from CInitializationParserFunctor | |
int | debug_level |
The debug level. More... | |
bool | write_in_a_file |
the data will be written in a data copied by the caller More... | |
std::string | file_variable |
variable used to write in a variable More... | |
Functor used to compute size of memory objects.
Definition at line 58 of file compute_reserved_memory.hpp.
ComputeReservedMemory::ComputeReservedMemory | ( | const tree_managerConstRef | _TM, |
const tree_nodeConstRef | _tn | ||
) |
Constructor.
Header include.
TM | is the tree manager |
tn | is the variable/parameter to be stored in memory |
STD include tree includes utility include
Definition at line 54 of file compute_reserved_memory.cpp.
|
inlineoverridevirtual |
In this case the function does not activate anything.
Implements CInitializationParserFunctor.
Definition at line 115 of file compute_reserved_memory.hpp.
|
overridevirtual |
Check that all the necessary information was present in the initialization string.
Implements CInitializationParserFunctor.
Definition at line 66 of file compute_reserved_memory.cpp.
References depth_level, and THROW_ASSERT.
|
inlineoverridevirtual |
do nothing
Implements CInitializationParserFunctor.
Definition at line 122 of file compute_reserved_memory.hpp.
unsigned long long ComputeReservedMemory::GetReservedBytes | ( | ) | const |
Return the computed value.
Definition at line 59 of file compute_reserved_memory.cpp.
References tree_helper::CGetPointedType(), tree_helper::CGetType(), elements_number, tree_helper::Size(), and tn.
|
overridevirtual |
Start the initialization of a new aggregated data structure.
Implements CInitializationParserFunctor.
Definition at line 71 of file compute_reserved_memory.cpp.
References depth_level.
|
overridevirtual |
Consume an element of an aggregated data structure.
For compatibility with old initialization (without parentheses)
Implements CInitializationParserFunctor.
Definition at line 76 of file compute_reserved_memory.cpp.
References depth_level, and elements_number.
|
overridevirtual |
Ends the initialization of the current aggregated data structure.
Implements CInitializationParserFunctor.
Definition at line 89 of file compute_reserved_memory.cpp.
References depth_level, and THROW_ASSERT.
|
overridevirtual |
Process an element.
content | is the string assocated with the string |
Implements CInitializationParserFunctor.
Definition at line 95 of file compute_reserved_memory.cpp.
|
private |
The current level of {}.
Definition at line 71 of file compute_reserved_memory.hpp.
Referenced by CheckEnd(), GoDown(), GoNext(), and GoUp().
|
private |
The number of elements in the top level.
Definition at line 68 of file compute_reserved_memory.hpp.
Referenced by GetReservedBytes(), and GoNext().
|
private |
The tree manager.
Definition at line 62 of file compute_reserved_memory.hpp.
|
private |
The tree node to be stored in memory.
Definition at line 65 of file compute_reserved_memory.hpp.
Referenced by GetReservedBytes().