PandA-2024.02
Public Member Functions | Private Attributes
ComputeReservedMemory Class Reference

Functor used to compute size of memory objects. More...

#include <compute_reserved_memory.hpp>

Inheritance diagram for ComputeReservedMemory:
Inheritance graph
[legend]
Collaboration diagram for ComputeReservedMemory:
Collaboration graph
[legend]

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...
 

Detailed Description

Functor used to compute size of memory objects.

Definition at line 58 of file compute_reserved_memory.hpp.

Constructor & Destructor Documentation

◆ ComputeReservedMemory()

ComputeReservedMemory::ComputeReservedMemory ( const tree_managerConstRef  _TM,
const tree_nodeConstRef  _tn 
)

Constructor.

Header include.

Parameters
TMis the tree manager
tnis the variable/parameter to be stored in memory

STD include tree includes utility include

Definition at line 54 of file compute_reserved_memory.cpp.

Member Function Documentation

◆ ActivateFileInit()

void ComputeReservedMemory::ActivateFileInit ( const std::string &  )
inlineoverridevirtual

In this case the function does not activate anything.

Implements CInitializationParserFunctor.

Definition at line 115 of file compute_reserved_memory.hpp.

◆ CheckEnd()

void ComputeReservedMemory::CheckEnd ( )
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.

◆ FinalizeFileInit()

void ComputeReservedMemory::FinalizeFileInit ( )
inlineoverridevirtual

do nothing

Implements CInitializationParserFunctor.

Definition at line 122 of file compute_reserved_memory.hpp.

◆ GetReservedBytes()

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.

Here is the call graph for this function:

◆ GoDown()

void ComputeReservedMemory::GoDown ( )
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.

◆ GoNext()

void ComputeReservedMemory::GoNext ( )
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.

◆ GoUp()

void ComputeReservedMemory::GoUp ( )
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.

◆ Process()

void ComputeReservedMemory::Process ( const std::string &  content)
overridevirtual

Process an element.

Parameters
contentis the string assocated with the string

Implements CInitializationParserFunctor.

Definition at line 95 of file compute_reserved_memory.cpp.

Field Documentation

◆ depth_level

unsigned int ComputeReservedMemory::depth_level
private

The current level of {}.

Definition at line 71 of file compute_reserved_memory.hpp.

Referenced by CheckEnd(), GoDown(), GoNext(), and GoUp().

◆ elements_number

unsigned int ComputeReservedMemory::elements_number
private

The number of elements in the top level.

Definition at line 68 of file compute_reserved_memory.hpp.

Referenced by GetReservedBytes(), and GoNext().

◆ TM

const tree_managerConstRef ComputeReservedMemory::TM
private

The tree manager.

Definition at line 62 of file compute_reserved_memory.hpp.

◆ tn

const tree_nodeConstRef ComputeReservedMemory::tn
private

The tree node to be stored in memory.

Definition at line 65 of file compute_reserved_memory.hpp.

Referenced by GetReservedBytes().


The documentation for this class was generated from the following files:

Generated on Mon Feb 12 2024 13:03:48 for PandA-2024.02 by doxygen 1.8.13