C++ main module for stochmagnet Package
1.0
|
this class describes a class factory to generate classes of the package More...
#include <SM_ClassFactory.h>
Public Member Functions | |
SM_ClassFactory () | |
build a SM_ClassFactory More... | |
virtual | ~SM_ClassFactory (void) |
destroy a SM_ClassFactory More... | |
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_Object > | NewInstance (const tString &name, const std::map< tString, tString > &arguments) const override |
create an unique instance of a class 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... | |
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< SM_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... | |
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 of the package
SM_ClassFactory::SM_ClassFactory | ( | ) |
|
virtual |
destroy a SM_ClassFactory
|
inlineinherited |
add to class factory
[in] | child | the class factory to add |
References CORE_ClassFactory::mFactoryClasses.
Referenced by SM_Run::createClassFactories().
|
inlineinherited |
clear the class factories list
References CORE_ClassFactory::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.
|
inlineoverridevirtualinherited |
return the memory size in byte
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize(), CORE_ClassFactory::mFactoryClasses, and tMemSize.
Referenced by getMemorySize(), and CORE_ClassFactory::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(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inlinevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from CORE_ClassFactory.
References CORE_ClassFactory::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 SM_ClassFactory().
Referenced by SM_Run::createClassFactories().
|
inlineinherited |
create an unique instance of a class as a general CORE_Object
[in] | name | name of the class to create |
References CORE_ClassFactory::NewInstance().
|
overridevirtual |
create an unique instance of a class
[in] | name | name of the class to create |
[in] | arguments | : arguments of the class (name,value) |
Reimplemented from CORE_ClassFactory.
References SM_Beam::New(), SM_ConstantNoiseRateFunction::New(), SM_ConstantZeemanOperator::New(), SM_DemagnetizedOperator::New(), SM_HeissenbergOperator::New(), SM_InverseNoiseRateFunction::New(), SM_ItoSystem::New(), SM_Network::New(), SM_PermanentZeemanOperator::New(), SM_StratonovichNormalizedSystem::New(), SM_StratonovichSystem::New(), SM_TimeStepper::New(), SM_ZeemanOperator::New(), SMS_BoostNormalFunction::New(), SMS_STDNormalFunction::New(), CORE_ClassFactory::NewInstance(), tIndex, and tString.
|
inlineinherited |
create a shared instance of a class with same type as T with no argument
|
inlineinherited |
create a shared instance of a class with same type as T
[in] | arguments | : arguments |
References CORE_ClassFactory::NewInstance().
|
inlineinherited |
create a shared instance of a class with no argument
[in] | name | name of the class to create |
References CORE_ClassFactory::NewInstance().
|
inlineinherited |
create a shared instance of a class
[in] | name | name of the class to create |
[in] | arguments | : arguments of the class (name,value) |
References CORE_ClassFactory::NewInstance().
|
inlinestaticinherited |
create a shared instance of an unique pointer as a lvalue
[in] | up | unique pointer |
|
inlinestaticinherited |
create a shared instance of an unique pointer
[in] | up | unique pointer |
|
inlineinherited |
create an unique instance of a class T with no arguments
[in] | name | name of the class to create |
References CORE_ClassFactory::NewInstance().
|
inlineinherited |
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 CORE_ClassFactory::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.
|
inlineoverridevirtualinherited |
get the string representation of the class
Reimplemented from CORE_Object.
References CORE_Object::getIdentityString(), and CORE_ClassFactory::mFactoryClasses.
|
privateinherited |
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().