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

this class describes the chono class by default write on standart output More...

#include <CORE_Chrono.h>

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

Public Member Functions

 CORE_Chrono ()
 build a CORE_Chrono More...
 
virtual ~CORE_Chrono (void)
 destroy a CORE_Chrono More...
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class and the memory size of all its attributes/associations More...
 
void start ()
 start the chrono More...
 
std::chrono::duration< tRealstop ()
 stop the chrono and return the duration time in seconds as a real More...
 
tString getDate ()
 get the date in string 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 tULLInt GetClockTime ()
 
static tULLInt GetClockDuration (const tULLInt &startTime)
 
static tULLInt ConvertDuration (std::chrono::duration< tReal > &&duration)
 convert duration in ms @retunr the duration in milli seconds More...
 
static tULLInt ConvertDuration (const std::chrono::duration< tReal > &duration)
 convert duration in ms @retunr the duration in milli seconds More...
 
static tReal ConvertDuration (std::chrono::duration< tReal > &&duration, tUInt &d, tUInt &h, tUInt &m, tUInt &s, tUInt &ms, tUInt &mus, tUInt &ns)
 convert the duration as days,hours,minutes,second,milliseconds,microseconds More...
 
static tReal ConvertDuration (std::chrono::duration< tReal > &duration, tUInt &d, tUInt &h, tUInt &m, tUInt &s, tUInt &ms, tUInt &mus, tUInt &ns)
 convert the duration as days,hours,minutes,second,milliseconds,microseconds More...
 
static tString GetDate ()
 
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::chrono::high_resolution_clock mTimer
 
std::chrono::time_point< std::chrono::high_resolution_clock > mStart
 
tUInt mYear
 
tCInt mMonth
 
tUCInt mDay
 
tUCInt mWeekDay
 
tUCInt mHour
 
tUCInt mMinute
 
tUCInt mSecond
 
std::weak_ptr< CORE_ObjectmThis
 

Detailed Description

this class describes the chono class by default write on standart output

Constructor & Destructor Documentation

◆ CORE_Chrono()

CORE_Chrono::CORE_Chrono ( )
inline

build a CORE_Chrono

References mDay, mHour, mMinute, mMonth, mSecond, mWeekDay, and mYear.

◆ ~CORE_Chrono()

virtual CORE_Chrono::~CORE_Chrono ( void  )
inlinevirtual

destroy a CORE_Chrono

Member Function Documentation

◆ ConvertDuration() [1/4]

static tULLInt CORE_Chrono::ConvertDuration ( const std::chrono::duration< tReal > &  duration)
inlinestatic

convert duration in ms @retunr the duration in milli seconds

◆ ConvertDuration() [2/4]

static tULLInt CORE_Chrono::ConvertDuration ( std::chrono::duration< tReal > &&  duration)
inlinestatic

◆ ConvertDuration() [3/4]

static tReal CORE_Chrono::ConvertDuration ( std::chrono::duration< tReal > &&  duration,
tUInt d,
tUInt h,
tUInt m,
tUInt s,
tUInt ms,
tUInt mus,
tUInt ns 
)
inlinestatic

convert the duration as days,hours,minutes,second,milliseconds,microseconds

Parameters
[in]durationduration as a real expressed in seconds as a lvalue
[out]dnumber of days
[out]hnumber of hours
[out]mnumber of minutes
[out]snumber of seconds
[out]msnumber of milli-seconds
[out]musnumber of micro-seconds
[out]nsnumber of nano-seconds

duration*1000*1000 = mus+1000*(ms+1000*(s+60*(m+60*(h+24*d))))

Returns
the duration

References tReal.

◆ ConvertDuration() [4/4]

static tReal CORE_Chrono::ConvertDuration ( std::chrono::duration< tReal > &  duration,
tUInt d,
tUInt h,
tUInt m,
tUInt s,
tUInt ms,
tUInt mus,
tUInt ns 
)
inlinestatic

convert the duration as days,hours,minutes,second,milliseconds,microseconds

Parameters
[in]durationduration as a real expressed in seconds as a reference
[out]dnumber of days
[out]hnumber of hours
[out]mnumber of minutes
[out]snumber of seconds
[out]msnumber of milli-seconds
[out]musnumber of micro-seconds
[out]nsnumber of nano-seconds

duration*1000*1000 = mus+1000*(ms+1000*(s+60*(m+60*(h+24*d))))

Returns
the duration

References tReal.

◆ 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 CORE_Run::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:

◆ 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:

◆ GetClockDuration()

static tULLInt CORE_Chrono::GetClockDuration ( const tULLInt startTime)
inlinestatic

◆ GetClockTime()

static tULLInt CORE_Chrono::GetClockTime ( )
inlinestatic

◆ 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_Object::getContentsMemorySize ( ) const
inlinevirtualinherited

return nthe memory size of the included associations

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 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(), getMemorySize(), CORE_Collection< T, I >::getMemorySize(), CORE_IO::getMemorySize(), CORE_List< T, K, I >::getMemorySize(), CORE_OptionsReader::getMemorySize(), CORE_OutputFile::getMemorySize(), and CORE_Test::getMemorySize().

Here is the caller graph for this function:

◆ getDate()

tString CORE_Chrono::getDate ( )
inline

get the date in string

Returns
YYYY/MM/DD-HH:MM:SS

References mDay, mHour, mMinute, mMonth, mSecond, and mYear.

Referenced by GetDate().

Here is the caller graph for this function:

◆ GetDate()

static tString CORE_Chrono::GetDate ( )
inlinestatic

References getDate().

Referenced by SM_Run::run(), and CORE_OptionsReader::SaveOptionsToFile().

Here is the call graph for this function:
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_Chrono::getMemorySize ( ) const
inlineoverridevirtual

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 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

References CORE_Object::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.

◆ 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:

◆ 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:

◆ 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.

◆ start()

void CORE_Chrono::start ( )
inline

◆ stop()

std::chrono::duration<tReal> CORE_Chrono::stop ( )
inline

◆ toString()

virtual tString CORE_Object::toString ( ) const
inlinevirtualinherited

Member Data Documentation

◆ mDay

tUCInt CORE_Chrono::mDay
private

Referenced by CORE_Chrono(), and getDate().

◆ mHour

tUCInt CORE_Chrono::mHour
private

Referenced by CORE_Chrono(), and getDate().

◆ mMinute

tUCInt CORE_Chrono::mMinute
private

Referenced by CORE_Chrono(), and getDate().

◆ mMonth

tCInt CORE_Chrono::mMonth
private

Referenced by CORE_Chrono(), and getDate().

◆ mSecond

tUCInt CORE_Chrono::mSecond
private

Referenced by CORE_Chrono(), and getDate().

◆ mStart

std::chrono::time_point<std::chrono::high_resolution_clock> CORE_Chrono::mStart
private

Referenced by start(), and stop().

◆ mThis

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

◆ mTimer

std::chrono::high_resolution_clock CORE_Chrono::mTimer
private

Referenced by start(), and stop().

◆ mWeekDay

tUCInt CORE_Chrono::mWeekDay
private

Referenced by CORE_Chrono().

◆ mYear

tUInt CORE_Chrono::mYear
private

Referenced by CORE_Chrono(), and getDate().


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