COPASI API
4.40.278
|
#include <CopasiTime.h>
Public Member Functions | |
CCopasiTimeVariable () | |
CCopasiTimeVariable (const C_INT64 &value) | |
CCopasiTimeVariable (const CCopasiTimeVariable &src) | |
C_INT64 | getDays () const |
C_INT64 | getHours (const bool &bounded=false) const |
C_INT64 | getMicroSeconds (const bool &bounded=false) const |
C_INT64 | getMilliSeconds (const bool &bounded=false) const |
C_INT64 | getMinutes (const bool &bounded=false) const |
C_INT64 | getSeconds (const bool &bounded=false) const |
std::string | isoFormat (const bool &printMicroSecond=true) const |
bool | isZero () const |
CCopasiTimeVariable | operator+ (const CCopasiTimeVariable &value) |
CCopasiTimeVariable | operator- (const CCopasiTimeVariable &value) |
bool | operator< (const CCopasiTimeVariable &value) |
CCopasiTimeVariable & | operator= (const C_INT64 &value) |
CCopasiTimeVariable & | operator= (const CCopasiTimeVariable &rhs) |
~CCopasiTimeVariable () | |
Static Public Member Functions | |
static CCopasiTimeVariable | getCurrentWallTime () |
static CCopasiTimeVariable | getProcessTime () |
static CCopasiTimeVariable | getThreadTime () |
static std::string | LL2String (const C_INT64 &value, const C_INT32 &digits=0) |
Private Attributes | |
C_INT64 | mTime |
This class is for handling execution time related values. static methods for retreiving wall clock and CPU time are provided.
CCopasiTimeVariable::CCopasiTimeVariable | ( | ) |
Default constructor.
CCopasiTimeVariable::CCopasiTimeVariable | ( | const CCopasiTimeVariable & | src | ) |
Copy constructor.
const | CCopasiTimeVariable & src |
CCopasiTimeVariable::CCopasiTimeVariable | ( | const C_INT64 & | value | ) |
Specific constructor from a C_INT64 value.
const | C_INT64 & value |
CCopasiTimeVariable::~CCopasiTimeVariable | ( | ) |
Destructor.
|
static |
Retrieve the current wall clock time in micro seconds since 1970-01-01:00:00:00.0
References C_INT64, and LLONG_CONST.
Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), CProcessReport::CProcessReport(), CRandom::getSystemSeed(), CProcessReport::proceed(), and CCopasiTimer::start().
C_INT64 CCopasiTimeVariable::getDays | ( | ) | const |
Retrieve the time in days.
const | bool & bounded (default: false) |
References C_INT64, LLONG_CONST, and mTime.
Referenced by isoFormat().
C_INT64 CCopasiTimeVariable::getHours | ( | const bool & | bounded = false | ) | const |
Retrieve the time in hours. If bounded is true 0 <= hours < 24
const | bool & bounded (default: false) |
References C_INT64, LLONG_CONST, and mTime.
Referenced by isoFormat().
C_INT64 CCopasiTimeVariable::getMicroSeconds | ( | const bool & | bounded = false | ) | const |
Retrieve the time in micro seconds. If bounded is true 0 <= microSeconds < 1000
const | bool & bounded (default: false) |
References LLONG_CONST, and mTime.
Referenced by CCopasiTimer::calculateValue(), CRandom::getSystemSeed(), and isoFormat().
C_INT64 CCopasiTimeVariable::getMilliSeconds | ( | const bool & | bounded = false | ) | const |
Retrieve the time in milli seconds. If bounded is true 0 <= milliSeconds < 1000
const | bool & bounded (default: false) |
References C_INT64, LLONG_CONST, and mTime.
Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().
C_INT64 CCopasiTimeVariable::getMinutes | ( | const bool & | bounded = false | ) | const |
Retrieve the time in minutes. If bounded is true 0 <= minutes < 60
const | bool & bounded (default: false) |
References C_INT64, LLONG_CONST, and mTime.
Referenced by isoFormat().
|
static |
Retrieve the current process CPU time used since the start of the process.
References C_INT64, and LLONG_CONST.
Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), and CCopasiTimer::start().
C_INT64 CCopasiTimeVariable::getSeconds | ( | const bool & | bounded = false | ) | const |
Retrieve the time in seconds. If bounded is true 0 <= seconds < 60
const | bool & bounded (default: false) |
References C_INT64, LLONG_CONST, and mTime.
Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().
|
static |
Retrieve the current process thread time used since the start of the process.
References C_INT64, LLONG_CONST, and RUSAGE_THREAD.
Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), and CCopasiTimer::start().
std::string CCopasiTimeVariable::isoFormat | ( | const bool & | printMicroSecond = true | ) | const |
Create a iso formated string (D:HH:MM:SS.ssssss)
const | bool & printMicroSecond (default: true) |
References getDays(), getHours(), getMicroSeconds(), getMilliSeconds(), getMinutes(), getSeconds(), isoFormat(), LL2String(), LLONG_CONST, and mTime.
Referenced by isoFormat().
bool CCopasiTimeVariable::isZero | ( | ) | const |
References mTime.
|
static |
Helper function to convert a C_INT32 to a std::string. If the number of digits is non zero the value is padded with zeros.
const | C_INT64 & value |
const | C_INT32 & digits (default: 0) |
References StringPrint().
Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().
CCopasiTimeVariable CCopasiTimeVariable::operator+ | ( | const CCopasiTimeVariable & | value | ) |
Operator + for adding CCopasiTimeVariables
const | CCopasiTimeVariable & value |
References mTime.
CCopasiTimeVariable CCopasiTimeVariable::operator- | ( | const CCopasiTimeVariable & | value | ) |
Operator - for subtracting CCopasiTimeVariables
const | CCopasiTimeVariable & value |
References mTime.
bool CCopasiTimeVariable::operator< | ( | const CCopasiTimeVariable & | value | ) |
Coparison operator <
const | CCopasiTimeVariable & value |
References mTime.
CCopasiTimeVariable & CCopasiTimeVariable::operator= | ( | const C_INT64 & | value | ) |
Assignement operator assigning a C_INT64 value to a CCopasiTimeVariable
const | CCopasiTimeVariable & rhs |
References mTime.
CCopasiTimeVariable & CCopasiTimeVariable::operator= | ( | const CCopasiTimeVariable & | rhs | ) |
Assignement operator
const | CCopasiTimeVariable & rhs |
References mTime.
|
private |
Value containing the time in micro seconds.
Referenced by getDays(), getHours(), getMicroSeconds(), getMilliSeconds(), getMinutes(), getSeconds(), isoFormat(), isZero(), operator+(), operator-(), operator<(), and operator=().