C++ main module for stochmagnet Package
1.0
|
This class is a Run class for core package. More...
#include <CORE_OptionsReader.h>
Public Member Functions | |
CORE_OptionsReader (void) | |
create More... | |
virtual | ~CORE_OptionsReader (void) |
destroy More... | |
virtual tMemSize | getMemorySize () const override |
return the memory size 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... | |
virtual tMemSize | getContentsMemorySize () const |
return nthe memory size of the included associations 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 tBoolean | ReadOptions (const tString &fileName, std::map< tString, tString > &options) |
read the options from a file More... | |
static void | ReadOptions (int argc, char *argv[], std::map< tString, tString > &options) |
read all the options from the command line More... | |
static tBoolean | ReadOption (int nArgs, char *argv[], const tString &optionName, tString &optionValue) |
read the only the option with optionName in command line More... | |
template<typename T , std::enable_if_t< std::is_floating_point_v< T >> * = nullptr> | |
static T | ReadNumericValue (const tString &strValue) |
read a numeric value of type T More... | |
template<typename T , std::enable_if_t< std::is_integral_v< T >> * = nullptr> | |
static T | ReadNumericValue (const tString &strValue) |
read a numeric value of type T More... | |
static tReal | ReadReal (const tString &strValue) |
read areal More... | |
static tInteger | ReadInteger (const tString &strValue) |
read a natural integer More... | |
static tInteger | ReadRelativeInteger (const tString &strValue) |
read a relative integer More... | |
static tInt | ReadInt (const tString &strValue) |
read an int More... | |
static tBoolean | ReadBoolean (const tString &strValue) |
read the boolean from option More... | |
template<class T > | |
static tBoolean | ReadVector (tString ¤t, std::vector< T > &values) |
template<class T , tIndex N> | |
static tBoolean | ReadArray (tString ¤t, std::array< T, N > &values) |
static tString | ReadPath (const tString &value) |
read a path from a string More... | |
static tBoolean | SaveOptionsToFile (const std::map< tString, std::map< tString, tString > > &manOptions, const std::map< tString, tString > &options) |
save the options to the file More... | |
static tBoolean | SaveOptionsToFile (const tString &fileName, const std::map< tString, std::map< tString, tString > > &manOptions, const std::map< tString, tString > &options) |
save the options to the file by theme More... | |
static CORE_Out & | PrintOptions (CORE_Out &out, const std::map< tString, tString > &options) |
print the options 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... | |
Static Private Member Functions | |
static void | RegisterOption (tString &arg, std::map< tString, tString > &options) |
register the option More... | |
static void | ReadOptionValue (tString &optionValue) |
read the option value More... | |
Private Attributes | |
std::weak_ptr< CORE_Object > | mThis |
This class is a Run class for core package.
The program is launch as follow:
core.exe [options] make [args]
with options:
wuih type:
execute core.exe –help to show the man
|
inline |
create
|
inlinevirtual |
destroy
|
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.
|
inlinevirtualinherited |
return nthe memory size of the included associations
Reimplemented in CORE_VectorList< T, I >, CORE_VectorList< tString, CORE_StringsList >, CORE_ValArray< T, I >, CORE_ValArray< T, CORE_StdValArray< T > >, CORE_Run, CORE_PtrArray< T, I >, CORE_PtrArray< T, CORE_StdPtrArray< T > >, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_ClassFactory, SMS_STDUniformFunction, SMS_STDNormalFunction, SMS_BoostUniformFunction, SMS_BoostNormalFunction, SM_ZeemanOperator, SM_XDMF, SM_VTK, SM_System, SM_Output, SM_Operator, SM_Network, SM_DemagnetizedOperator, SM_Beam, CORE_StringsList, and CORE_Out.
Referenced by CORE_Out::getContentsMemorySize(), SM_Beam::getContentsMemorySize(), SM_Network::getContentsMemorySize(), SM_Operator::getContentsMemorySize(), SM_Output::getContentsMemorySize(), SM_System::getContentsMemorySize(), SM_VTK::getContentsMemorySize(), SMS_BoostNormalFunction::getContentsMemorySize(), SMS_BoostUniformFunction::getContentsMemorySize(), SMS_STDNormalFunction::getContentsMemorySize(), SMS_STDUniformFunction::getContentsMemorySize(), CORE_ClassFactory::getContentsMemorySize(), CORE_PtrArray< T, I >::getContentsMemorySize(), CORE_ValArray< T, I >::getContentsMemorySize(), CORE_VectorList< T, I >::getContentsMemorySize(), CORE_Object::getMemorySize(), SM_ConstantNoiseRateFunction::getMemorySize(), SM_InverseNoiseRateFunction::getMemorySize(), SM_LandauLifschitzFunction::getMemorySize(), SM_NoiseRateFunction::getMemorySize(), SM_Object::getMemorySize(), SM_StochasticFunction::getMemorySize(), SM_TemplatedNoiseRateFunction< DerivedClass >::getMemorySize(), SM_TimeStepper::getMemorySize(), SMS_BoostRandomFunction::getMemorySize(), CORE_Array< T, I >::getMemorySize(), CORE_Chrono::getMemorySize(), CORE_Collection< T, I >::getMemorySize(), CORE_IO::getMemorySize(), CORE_List< T, K, I >::getMemorySize(), getMemorySize(), CORE_OutputFile::getMemorySize(), and CORE_Test::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().
|
inlineoverridevirtual |
return the memory size of the class
Reimplemented from CORE_Object.
References CORE_Object::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 |
print the options
[in,out] | out | the output stream |
[in] | options | the options to save in file options["name"]="value" |
Referenced by SM_Run::run().
read the boolean from option
[in] | strValue | : option value |
References core_functions::toLower(), core_functions::trim(), and tString.
Referenced by SM_Run::loadBeamFromOptions(), CORE_Run::SetDebugOptions(), and CORE_Run::SetOutputOptions().
read an int
[in] | strValue | : value as a string |
read a natural integer
[in] | strValue | : value as a string |
|
inlinestatic |
read a numeric value of type T
[in] | strValue | : value as a string |
|
inlinestatic |
read a numeric value of type T
[in] | strValue | : value as a string |
|
static |
read the only the option with optionName in command line
[in] | nArgs | number of parameters of the command line |
[in] | argv | : value of the parameters |
[in] | optionName | value of the option |
[out] | optionValue | : value of the option |
References ReadOptionValue(), tIndex, and tString.
Referenced by CORE_Run::executeRun().
|
static |
read the options from a file
[in] | fileName | file name of the options |
[in] | options | : options values optName -> optValue as a string |
References RegisterOption(), tChar, tIndex, core_functions::trim(), tString, and tUSInt.
Referenced by CORE_Run::executeRun(), and CORE_Test::testCase().
|
static |
read all the options from the command line
[in] | argc | number of parameter of the command line |
[in] | argv | : value of the parameters |
[in] | options | : options values optName -> optValue as a string |
References RegisterOption(), tIndex, and tString.
|
staticprivate |
read the option value
[in,out] | optionValue | : value of the option read the affectation value after '=' which is either:
|
References tIndex, and core_functions::trim().
Referenced by ReadOption(), and RegisterOption().
read a path from a string
[in] | value | : value as a string |
References CORE_IO::GetAbsolutePath().
Referenced by SM_Run::generateOutput(), SaveOptionsToFile(), CORE_Run::SetOutputOptions(), and CORE_Test::testCase().
read areal
[in] | strValue | : value as a string |
read a relative integer
[in] | strValue | : value as a string |
|
inlinestatic |
References core_functions::parse(), tIndex, and tString.
Referenced by SM_Run::generateOutput(), SM_Run::loadMagneticMomentFromOptions(), SM_Run::loadNetworkFromOptions(), and SM_Run::loadOperatorsFromOptions().
|
staticprivate |
register the option
[in] | arg | : argumen of the form:
|
[in,out] | options | (key,value) registered in options map |
References ReadOptionValue(), tIndex, core_functions::trim(), and tString.
Referenced by ReadOptions().
|
inlinestatic |
save the options to the file
[in] | manOptions | the option descriptions |
[in] | options | the options to save in file |
References ReadPath().
Referenced by SM_Run::makeRun().
|
static |
save the options to the file by theme
[in] | fileName | the options file to save |
[in] | manOptions | explanation of the options by theme manOptions["theme"]["name"]="explanation" |
[in] | options | the options to save in file options["name"]="value" |
References CORE_Chrono::GetDate(), tBoolean, tIndex, and tString.
|
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.
|
inlinevirtualinherited |
return the string representation of the object node
Reimplemented in SM_TimeStepper, SM_System, SM_StochasticFunction, SM_Network, SM_LandauLifschitzFunction, SM_Beam, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_Collection< T, I >, CORE_ClassFactory, and SM_NoiseRateFunction.
References CORE_Object::getIdentityString().
Referenced by SM_Run::run(), CORE_Collection< T, I >::toString(), SM_Beam::toString(), SM_Network::toString(), SM_StochasticFunction::toString(), SM_System::toString(), and SM_TimeStepper::toString().
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().