C++ main module for stochmagnet Package
1.0
|
this class describes a class factory to generate classes More...
#include <CORE_ClassFactory.h>
Public Member Functions | |
virtual tMemSize | getMemorySize () const override |
return the memory size of the class and the memory size of all its attributes/associations More... | |
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 More... | |
virtual CORE_UniquePointer< CORE_Object > | NewInstance (const tString &name, const std::map< tString, tString > &arguments) const |
create an unique instance of a class as a general CORE_Object More... | |
CORE_UniquePointer< CORE_Object > | NewInstance (const tString &name) const |
create an unique instance of a class as a general CORE_Object More... | |
template<class T > | |
CORE_UniquePointer< T > | NewUniqueInstance (const tString &name, const std::map< tString, tString > &arguments) const |
create an unique instance of a class T More... | |
template<class T > | |
CORE_UniquePointer< T > | NewUniqueInstance (const tString &name) const |
create an unique instance of a class T with no arguments More... | |
template<class T > | |
CORE_SharedPointer< T > | NewSharedInstance (const tString &name, const std::map< tString, tString > &arguments) const |
create a shared instance of a class More... | |
template<class T > | |
CORE_SharedPointer< T > | NewSharedInstance (const tString &name) const |
create a shared instance of a class with no argument More... | |
template<class T > | |
CORE_SharedPointer< T > | NewSharedInstance () const |
create a shared instance of a class with same type as T with no argument More... | |
template<class T > | |
CORE_SharedPointer< T > | NewSharedInstance (const std::map< tString, tString > &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... | |
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< CORE_ClassFactory > | New () |
build a new instance of default class factory More... | |
template<class T > | |
static CORE_SharedPointer< T > | NewSharedInstance (CORE_UniquePointer< T > &up) |
create a shared instance of an unique pointer More... | |
template<class T > | |
static CORE_SharedPointer< T > | NewSharedInstance (CORE_UniquePointer< T > &&up) |
create a shared instance of an unique pointer as a lvalue More... | |
static tBoolean | EnableMemoryStack (const tBoolean &isMemoryChecked) |
enable the memory stack More... | |
static void | EnableMemoryStack () |
enable the memory stack More... | |
static void | DisableMemoryStack () |
disable the memory stack More... | |
static tBoolean | IsMemoryStackEnabled () |
return trur if the memory stack is enabled More... | |
static tString | MemoryStackToString () |
get the memory stack in string More... | |
static tIndex | GetRegisteredClassesNumber () |
get the memory stack in string More... | |
Protected Member Functions | |
CORE_ClassFactory () | |
build a CORE_ClassFactory More... | |
virtual | ~CORE_ClassFactory (void) |
destroy a CORE_ClassFactory More... | |
Private Member Functions | |
template<class T > | |
std::shared_ptr< T > | setThis (std::unique_ptr< T, CORE_Object::Delete > &up) |
set the shared pointer from an unique pointer More... | |
Private Attributes | |
std::vector< CORE_UniquePointer< CORE_ClassFactory > > | mFactoryClasses |
std::weak_ptr< CORE_Object > | mThis |
this class describes a class factory to generate classes
|
protected |
|
protectedvirtual |
destroy a CORE_ClassFactory
|
inline |
add to class factory
[in] | child | the class factory to add |
References mFactoryClasses.
Referenced by SM_Run::createClassFactories().
|
inline |
clear the class factories list
References mFactoryClasses.
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inlinestaticinherited |
enable the memory stack
Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().
|
inlinestaticinherited |
enable the memory stack
[in] | isMemoryChecked | : true to verify memory allocation of CORE_Object classes |
References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().
|
inlineinherited |
return the name of the class
Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().
|
inlineinherited |
return a const shared pointer for this
References CORE_Object::mThis.
|
inlineoverridevirtual |
return the memory size in byte
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize(), mFactoryClasses, and tMemSize.
Referenced by SM_ClassFactory::getMemorySize(), and getMemorySize().
|
inlineinherited |
retrun the string identification of the class
References CORE_Object::getClassName(), and core_functions::pointerToString().
Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inlineoverridevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from CORE_Object.
Reimplemented in SM_ClassFactory.
References getContentsMemorySize().
|
inlineinherited |
retrun the pointer of the class as a string
References core_functions::pointerToString().
|
inlinestaticinherited |
get the memory stack in string
|
inlineinherited |
return the shared pointer for this
References CORE_Object::mThis.
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by SM_Beam::templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
build a new instance of default class factory
References CORE_ClassFactory().
|
inline |
create an unique instance of a class as a general CORE_Object
[in] | name | name of the class to create |
References NewInstance().
|
virtual |
create an unique instance of a class as a general CORE_Object
[in] | name | name of the class to create |
[in] | arguments | : arguments of the class (name,value) |
Reimplemented in SM_ClassFactory.
References mFactoryClasses, CORE_StdPtrArray< T >::New(), and tIndex.
Referenced by NewInstance(), SM_ClassFactory::NewInstance(), NewSharedInstance(), and NewUniqueInstance().
|
inline |
create a shared instance of a class with same type as T with no argument
|
inline |
create a shared instance of a class with same type as T
[in] | arguments | : arguments |
References NewInstance().
|
inline |
create a shared instance of a class with no argument
[in] | name | name of the class to create |
References NewInstance().
|
inline |
create a shared instance of a class
[in] | name | name of the class to create |
[in] | arguments | : arguments of the class (name,value) |
References NewInstance().
|
inlinestatic |
create a shared instance of an unique pointer as a lvalue
[in] | up | unique pointer |
|
inlinestatic |
create a shared instance of an unique pointer
[in] | up | unique pointer |
|
inline |
create an unique instance of a class T with no arguments
[in] | name | name of the class to create |
References NewInstance().
|
inline |
create an unique instance of a class T
[in] | name | name of the class to create |
[in] | arguments | : arguments of the class (name,value) |
References NewInstance().
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), SM_Run::loadOperatorsFromOptions(), and SM_Test::testOperators().
|
inlineprivateinherited |
set the shared pointer from an unique pointer
[in,out] | up | unique pointer of the class at input, points to null pointer at output |
Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()
References CORE_Object::mThis.
|
inlineoverridevirtual |
get the string representation of the class
Reimplemented from CORE_Object.
References CORE_Object::getIdentityString(), and mFactoryClasses.
|
private |
Referenced by addClassFactory(), clearClassFactories(), getContentsMemorySize(), NewInstance(), and toString().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().