C++ main module for stochmagnet Package  1.0
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CORE_Run Class Reference

This class is an outpput results generator for stoch magnet program. More...

#include <CORE_Run.h>

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

Public Member Functions

 CORE_Run (void)
 create More...
 
virtual ~CORE_Run (void)
 destroy More...
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class More...
 
virtual tMemSize getContentsMemorySize () const override
 return the memory size in byte More...
 
virtual void initManOptions (std::map< tString, std::map< tString, tString > > &options) const
 init the man of the options More...
 
virtual void initOptions (std::map< tString, tString > &options) const
 default initialization of the options More...
 
virtual void createClassFactories (const std::map< tString, tString > &options) const
 create the class factories from options More...
 
tBoolean executeRun (int argc, char *argv[]) const
 run the program from main class More...
 
virtual tBoolean makeRun (const tString &command, const std::map< tString, tString > &options) const
 make Run command More...
 
virtual tBoolean makeTests (const std::map< tString, tString > &options) const
 make tests command More...
 
tBoolean printHelp (const std::map< tString, tString > &options) const
 print the help 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...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

static void SetSoftName (const tString &soft)
 set soft name More...
 
static const tStringGetSoftName ()
 get soft name More...
 
static void SetVersion (const tString &version)
 set the version More...
 
static const tStringGetVersion ()
 get the version More...
 
static const tBooleanIsProfiling ()
 retun true if the code is in profing mode More...
 
static tBoolean Is64Architecture ()
 return true if the machine is a 64 bits machine More...
 
static tBoolean Is32Architecture ()
 return true if the machine is a 32 bits machine More...
 
static void InitSeed (const unsigned int &seed)
 init the seed for uniform random generator More...
 
static void InitSeed ()
 init the seed for uniform random generator More...
 
static CORE_OutOut ()
 return the output stream More...
 
static void SetOutputOptions (const std::map< tString, tString > &option)
 create the output stream from the options More...
 
static void SetDebugOptions (const std::map< tString, tString > &option)
 create the debug data from options More...
 
static CORE_ClassFactoryGetClassFactory ()
 return the class factory 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::weak_ptr< CORE_ObjectmThis
 

Static Private Attributes

static tString mSoftName ="core.exe"
 
static tString mVersion ="VERSION"
 
static CORE_UniquePointer< CORE_OutmOut =CORE_Out::New()
 
static CORE_UniquePointer< CORE_ClassFactorymClassFactory =CORE_ClassFactory::New()
 
static tBoolean mIsProfiling =false
 

Detailed Description

This class is an outpput results generator for stoch magnet program.

This class is a Run class for core package.

This class is a Run class for Stoch Microm package.

Author
Stephane Despreaux
Version
2.0

The program is launch as follow:

core.exe [options] make [args]

with options:

wuih type:

execute core.exe –help to show the man

Author
Stephane Despreaux
Version
2.0

Constructor & Destructor Documentation

◆ CORE_Run()

CORE_Run::CORE_Run ( void  )

create

◆ ~CORE_Run()

CORE_Run::~CORE_Run ( void  )
virtual

destroy

References mClassFactory, and mOut.

Member Function Documentation

◆ createClassFactories()

void CORE_Run::createClassFactories ( const std::map< tString, tString > &  options) const
virtual

create the class factories from options

Parameters
[in]optionsthe options

Reimplemented in SM_Run.

Referenced by executeRun().

Here is the caller graph for this function:

◆ DisableMemoryStack()

static void CORE_Object::DisableMemoryStack ( )
inlinestaticinherited

disable the memory stack

Referenced by CORE_Object::EnableMemoryStack().

Here is the caller graph for this function:

◆ EnableMemoryStack() [1/2]

static void CORE_Object::EnableMemoryStack ( )
inlinestaticinherited

enable the memory stack

Referenced by CORE_Object::EnableMemoryStack(), and SetDebugOptions().

Here is the caller graph for this function:

◆ EnableMemoryStack() [2/2]

static tBoolean CORE_Object::EnableMemoryStack ( const tBoolean isMemoryChecked)
inlinestaticinherited

enable the memory stack

Parameters
[in]isMemoryChecked: true to verify memory allocation of CORE_Object classes
Returns
true if the memroy is checked

References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().

Here is the call graph for this function:

◆ executeRun()

tBoolean CORE_Run::executeRun ( int  argc,
char *  argv[] 
) const

run the program from main class

Parameters
[in]argcnumber of arguments
[in]argvthe char* value of the arguments
Returns
true if the running has succeeded

References createClassFactories(), initOptions(), makeRun(), makeTests(), printHelp(), CORE_OptionsReader::ReadOption(), CORE_OptionsReader::ReadOptions(), SetDebugOptions(), SetOutputOptions(), tInt, core_functions::trim(), and tString.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetClassFactory()

static CORE_ClassFactory& CORE_Run::GetClassFactory ( )
inlinestatic

return the class factory

Returns
the output stream

References mClassFactory.

Referenced by SM_Run::createClassFactories(), SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadBeamFromOptions(), SM_Run::loadOperatorsFromOptions(), and SM_Test::testOperators().

Here is the caller graph for this function:

◆ getClassName()

tString CORE_Object::getClassName ( ) const
inlineinherited

return the name of the class

Returns
the string name of the class

Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().

Here is the caller graph for this function:

◆ getConstSharedPointer()

template<class T >
std::shared_ptr<const T> CORE_Object::getConstSharedPointer ( ) const
inlineinherited

return a const shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ getContentsMemorySize()

virtual tMemSize CORE_Run::getContentsMemorySize ( ) const
inlineoverridevirtual

return the memory size in byte

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from CORE_Object.

References mClassFactory, and mOut.

Referenced by SM_Run::getMemorySize(), and getMemorySize().

Here is the caller graph for this function:

◆ getIdentityString()

tString CORE_Object::getIdentityString ( ) const
inlineinherited

retrun the string identification of the class

Returns
the string identity 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMemorySize()

virtual tMemSize CORE_Run::getMemorySize ( ) const
inlineoverridevirtual

return the memory size of the class

Returns
the memory size of the class in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

Reimplemented in SM_Run.

References getContentsMemorySize().

Here is the call graph for this function:

◆ getPointerString()

tString CORE_Object::getPointerString ( ) const
inlineinherited

retrun the pointer of the class as a string

Returns
the pointer of the calss as a string

References core_functions::pointerToString().

Here is the call graph for this function:

◆ GetRegisteredClassesNumber()

static tIndex CORE_Object::GetRegisteredClassesNumber ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

◆ getSharedPointer()

template<class T >
std::shared_ptr<T> CORE_Object::getSharedPointer ( )
inlineinherited

return the shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ GetSoftName()

static const tString& CORE_Run::GetSoftName ( )
inlinestatic

get soft name

Returns
the soft name

References mSoftName.

Referenced by printHelp(), and SM_Run::run().

Here is the caller graph for this function:

◆ GetVersion()

static const tString& CORE_Run::GetVersion ( )
inlinestatic

get the version

Returns
the version in string form

References mVersion.

Referenced by printHelp(), and SM_Run::run().

Here is the caller graph for this function:

◆ initManOptions()

void CORE_Run::initManOptions ( std::map< tString, std::map< tString, tString > > &  options) const
virtual

init the man of the options

Parameters
[in]optionsman of the options

Reimplemented in SM_Run.

Referenced by SM_Run::initManOptions(), and printHelp().

Here is the caller graph for this function:

◆ initOptions()

void CORE_Run::initOptions ( std::map< tString, tString > &  options) const
virtual

default initialization of the options

Parameters
[in]optionsdefault values of the options

Reimplemented in SM_Run.

Referenced by executeRun(), and SM_Run::initOptions().

Here is the caller graph for this function:

◆ InitSeed() [1/2]

static void CORE_Run::InitSeed ( )
inlinestatic

init the seed for uniform random generator

◆ InitSeed() [2/2]

static void CORE_Run::InitSeed ( const unsigned int &  seed)
inlinestatic

init the seed for uniform random generator

Parameters
[in]seed: seed for uniform random generator

Referenced by CORE_Test::primaryTests().

Here is the caller graph for this function:

◆ Is32Architecture()

static tBoolean CORE_Run::Is32Architecture ( )
inlinestatic

return true if the machine is a 32 bits machine

Returns
true is the computing is done in a 32 bits machine

References tLDouble.

Referenced by CORE_Test::testTypes().

Here is the caller graph for this function:

◆ Is64Architecture()

static tBoolean CORE_Run::Is64Architecture ( )
inlinestatic

return true if the machine is a 64 bits machine

Returns
true is the computing is done in a 64 bits machine

References tLDouble.

Referenced by SM_VTK::getVTKType(), and CORE_Test::testTypes().

Here is the caller graph for this function:

◆ isInstanceOf()

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

test if the clas T is an instance of this class

Returns
true if the object is an instance of T

Referenced by SM_Beam::templatedSimulate().

Here is the caller graph for this function:

◆ IsMemoryStackEnabled()

static tBoolean CORE_Object::IsMemoryStackEnabled ( )
inlinestaticinherited

return trur if the memory stack is enabled

Referenced by CORE_Object::EnableMemoryStack(), and main().

Here is the caller graph for this function:

◆ IsProfiling()

static const tBoolean& CORE_Run::IsProfiling ( )
inlinestatic

retun true if the code is in profing mode

Returns
true if the code is in profiling mode

References mIsProfiling.

◆ makeRun()

tBoolean CORE_Run::makeRun ( const tString command,
const std::map< tString, tString > &  options 
) const
virtual

make Run command

Parameters
[in]commandthe command to run
[in]optionsthe options of the program
Returns
true if the the executing of the program has succeeded

Reimplemented in SM_Run.

References makeTests().

Referenced by executeRun(), and CORE_Test::testCase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ makeTests()

tBoolean CORE_Run::makeTests ( const std::map< tString, tString > &  options) const
virtual

make tests command

Parameters
[in]optionsthe options of the program
Returns
true if the the executing of the tests of program has succeeded

Reimplemented in SM_Run.

References CORE_Test::execute().

Referenced by executeRun(), and makeRun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MemoryStackToString()

static tString CORE_Object::MemoryStackToString ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

Referenced by main().

Here is the caller graph for this function:

◆ Out()

static CORE_Out& CORE_Run::Out ( )
inlinestatic

◆ printHelp()

tBoolean CORE_Run::printHelp ( const std::map< tString, tString > &  options) const

print the help

Parameters
[in]optionsthe options of the program
Returns
always true

References GetSoftName(), GetVersion(), initManOptions(), Out(), and tString.

Referenced by executeRun().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetDebugOptions()

void CORE_Run::SetDebugOptions ( const std::map< tString, tString > &  option)
static

create the debug data from options

Parameters
[in]optionsdefault values of the options

References CORE_Object::EnableMemoryStack(), mIsProfiling, Out(), CORE_Out::println(), CORE_OptionsReader::ReadBoolean(), and tBoolean.

Referenced by executeRun(), and CORE_Test::testCase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetOutputOptions()

void CORE_Run::SetOutputOptions ( const std::map< tString, tString > &  option)
static

create the output stream from the options

Parameters
[in]optionsdefault values of the options

References CORE_Out::ALL_OUTPUT, CORE_Out::APPEND, CORE_Out::CREATE, CORE_Out::FILE_OUTPUT, CORE_Out::NO_OUTPUT, Out(), CORE_OptionsReader::ReadBoolean(), CORE_OptionsReader::ReadPath(), CORE_Out::SCREEN_OUTPUT, CORE_Out::setOutput(), CORE_Out::setOutputFile(), tBoolean, tFlag, tString, and CORE_Out::update().

Referenced by executeRun(), and CORE_Test::testCase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetSoftName()

static void CORE_Run::SetSoftName ( const tString soft)
inlinestatic

set soft name

Parameters
[in]softname of the soft

References mSoftName.

Referenced by SM_Run::SM_Run().

Here is the caller graph for this function:

◆ setThis()

template<class T >
std::shared_ptr<T> CORE_Object::setThis ( std::unique_ptr< T, CORE_Object::Delete > &  up)
inlineprivateinherited

set the shared pointer from an unique pointer

Parameters
[in,out]upunique pointer of the class at input, points to null pointer at output
Returns
the shared pointer of the class

Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()

References CORE_Object::mThis.

◆ SetVersion()

static void CORE_Run::SetVersion ( const tString version)
inlinestatic

set the version

Parameters
versionname of the version set the version of the code

References mVersion.

Referenced by SM_Run::SM_Run().

Here is the caller graph for this function:

◆ toString()

virtual tString CORE_Object::toString ( ) const
inlinevirtualinherited

Member Data Documentation

◆ mClassFactory

CORE_UniquePointer< CORE_ClassFactory > CORE_Run::mClassFactory =CORE_ClassFactory::New()
staticprivate

◆ mIsProfiling

tBoolean CORE_Run::mIsProfiling =false
staticprivate

Referenced by IsProfiling(), and SetDebugOptions().

◆ mOut

CORE_UniquePointer< CORE_Out > CORE_Run::mOut =CORE_Out::New()
staticprivate

◆ mSoftName

tString CORE_Run::mSoftName ="core.exe"
staticprivate

Referenced by GetSoftName(), and SetSoftName().

◆ mThis

std::weak_ptr<CORE_Object> CORE_Object::mThis
privateinherited

◆ mVersion

tString CORE_Run::mVersion ="VERSION"
staticprivate

Referenced by GetVersion(), and SetVersion().


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