C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | List of all members
SMOMPI_ClassFactory Class Reference

this class describes a class factory to generate classes of the package More...

#include <SMOMPI_ClassFactory.h>

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

Public Member Functions

 SMOMPI_ClassFactory ()
 build a SMOMPI_ClassFactory
 
virtual ~SMOMPI_ClassFactory (void)
 destroy a SMOMPI_ClassFactory
 
virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
virtual CORE_UniquePointer< CORE_ObjectNewInstance (const tString &name, const CORE_OptionsList &arguments) const override
 create an unique instance of a class More...
 
- Public Member Functions inherited from CORE_ClassFactory
virtual tMemSize getContentsMemorySize () const override
 return the memory size in byte More...
 
void addClassFactory (CORE_UniquePointer< CORE_ClassFactory > child)
 add to class factory More...
 
void clearClassFactories ()
 clear the class factories list
 
CORE_UniquePointer< CORE_ObjectNewInstance (const tString &name) const
 create an unique instance of a class as a general CORE_Object More...
 
template<class T >
CORE_UniquePointer< T > NewInstance (const tString &name, const CORE_OptionsList &arguments) const
 create an unique instance of a class T More...
 
template<class T >
CORE_UniquePointer< T > NewInstance (const tString &name) const
 create an unique instance of a class T with no arguments More...
 
template<class T >
CORE_SharedPointer< T > NewSharedPointer (const tString &name, const CORE_OptionsList &arguments) const
 create a shared instance of a class More...
 
template<class T >
CORE_SharedPointer< T > NewSharedPointer (const tString &name) const
 create a shared instance of a class with no argument More...
 
template<class T >
CORE_SharedPointer< T > NewSharedPointer () const
 create a shared instance of a class with same type as T with no argument More...
 
template<class T >
CORE_SharedPointer< T > NewSharedPointer (const CORE_OptionsList &arguments) const
 create a shared instance of a class with same type as T More...
 
virtual tString toString () const override
 get the string representation of the class More...
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Static Public Member Functions

static CORE_UniquePointer< SMOMPI_ClassFactoryNew ()
 build a new instance of default class factory More...
 
- Static Public Member Functions inherited from CORE_ClassFactory
static CORE_UniquePointer< CORE_ClassFactoryNew ()
 build a new instance of default class factory More...
 
template<class T >
static CORE_SharedPointer< T > NewSharedPointer (CORE_UniquePointer< T > &up)
 create a shared instance of an unique pointer More...
 
template<class T >
static CORE_SharedPointer< T > NewSharedPointer (CORE_UniquePointer< T > &&up)
 create a shared instance of an unique pointer as a lvalue More...
 
- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Additional Inherited Members

- Protected Member Functions inherited from CORE_ClassFactory
 CORE_ClassFactory ()
 build a CORE_ClassFactory
 
virtual ~CORE_ClassFactory (void)
 destroy a CORE_ClassFactory
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Detailed Description

this class describes a class factory to generate classes of the package

Member Function Documentation

◆ getMemorySize()

virtual tMemSize SMOMPI_ClassFactory::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_ClassFactory.

◆ New()

static CORE_UniquePointer<SMOMPI_ClassFactory> SMOMPI_ClassFactory::New ( )
inlinestatic

build a new instance of default class factory

Returns
an unique pointer of CORE_LassFactory

◆ NewInstance()

virtual CORE_UniquePointer<CORE_Object> SMOMPI_ClassFactory::NewInstance ( const tString &  name,
const CORE_OptionsList arguments 
) const
overridevirtual

create an unique instance of a class

Parameters
[in]namename of the class to create
[in]arguments: arguments of the class (name,value)
Returns
an unique pointer to the class with name return null if the name is not recognized

Reimplemented from CORE_ClassFactory.


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