COPASI API  4.40.278
CCopasiTimeVariable Class Reference

#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)
 
CCopasiTimeVariableoperator= (const C_INT64 &value)
 
CCopasiTimeVariableoperator= (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
 

Detailed Description

This class is for handling execution time related values. static methods for retreiving wall clock and CPU time are provided.

Constructor & Destructor Documentation

◆ CCopasiTimeVariable() [1/3]

CCopasiTimeVariable::CCopasiTimeVariable ( )

Default constructor.

◆ CCopasiTimeVariable() [2/3]

CCopasiTimeVariable::CCopasiTimeVariable ( const CCopasiTimeVariable src)

Copy constructor.

Parameters
constCCopasiTimeVariable & src

◆ CCopasiTimeVariable() [3/3]

CCopasiTimeVariable::CCopasiTimeVariable ( const C_INT64 value)

Specific constructor from a C_INT64 value.

Parameters
constC_INT64 & value

◆ ~CCopasiTimeVariable()

CCopasiTimeVariable::~CCopasiTimeVariable ( )

Destructor.

Member Function Documentation

◆ getCurrentWallTime()

CCopasiTimeVariable CCopasiTimeVariable::getCurrentWallTime ( )
static

Retrieve the current wall clock time in micro seconds since 1970-01-01:00:00:00.0

Returns
CCopasiTimeVariable time

References C_INT64, and LLONG_CONST.

Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), CProcessReport::CProcessReport(), CRandom::getSystemSeed(), CProcessReport::proceed(), and CCopasiTimer::start().

◆ getDays()

C_INT64 CCopasiTimeVariable::getDays ( ) const

Retrieve the time in days.

Parameters
constbool & bounded (default: false)
Returns
C_INT64 days

References C_INT64, LLONG_CONST, and mTime.

Referenced by isoFormat().

◆ getHours()

C_INT64 CCopasiTimeVariable::getHours ( const bool &  bounded = false) const

Retrieve the time in hours. If bounded is true 0 <= hours < 24

Parameters
constbool & bounded (default: false)
Returns
C_INT64 hours

References C_INT64, LLONG_CONST, and mTime.

Referenced by isoFormat().

◆ getMicroSeconds()

C_INT64 CCopasiTimeVariable::getMicroSeconds ( const bool &  bounded = false) const

Retrieve the time in micro seconds. If bounded is true 0 <= microSeconds < 1000

Parameters
constbool & bounded (default: false)
Returns
C_INT64 microSeconds

References LLONG_CONST, and mTime.

Referenced by CCopasiTimer::calculateValue(), CRandom::getSystemSeed(), and isoFormat().

◆ getMilliSeconds()

C_INT64 CCopasiTimeVariable::getMilliSeconds ( const bool &  bounded = false) const

Retrieve the time in milli seconds. If bounded is true 0 <= milliSeconds < 1000

Parameters
constbool & bounded (default: false)
Returns
C_INT64 milliSeconds

References C_INT64, LLONG_CONST, and mTime.

Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().

◆ getMinutes()

C_INT64 CCopasiTimeVariable::getMinutes ( const bool &  bounded = false) const

Retrieve the time in minutes. If bounded is true 0 <= minutes < 60

Parameters
constbool & bounded (default: false)
Returns
C_INT64 minutes

References C_INT64, LLONG_CONST, and mTime.

Referenced by isoFormat().

◆ getProcessTime()

CCopasiTimeVariable CCopasiTimeVariable::getProcessTime ( )
static

Retrieve the current process CPU time used since the start of the process.

Returns
CCopasiTimeVariable time

References C_INT64, and LLONG_CONST.

Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), and CCopasiTimer::start().

◆ getSeconds()

C_INT64 CCopasiTimeVariable::getSeconds ( const bool &  bounded = false) const

Retrieve the time in seconds. If bounded is true 0 <= seconds < 60

Parameters
constbool & bounded (default: false)
Returns
C_INT64 seconds

References C_INT64, LLONG_CONST, and mTime.

Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().

◆ getThreadTime()

CCopasiTimeVariable CCopasiTimeVariable::getThreadTime ( )
static

Retrieve the current process thread time used since the start of the process.

Returns
CCopasiTimeVariable time

References C_INT64, LLONG_CONST, and RUSAGE_THREAD.

Referenced by CCopasiTimer::calculateValue(), CCopasiTimer::CCopasiTimer(), and CCopasiTimer::start().

◆ isoFormat()

std::string CCopasiTimeVariable::isoFormat ( const bool &  printMicroSecond = true) const

Create a iso formated string (D:HH:MM:SS.ssssss)

Parameters
constbool & printMicroSecond (default: true)
Returns
std::string

References getDays(), getHours(), getMicroSeconds(), getMilliSeconds(), getMinutes(), getSeconds(), isoFormat(), LL2String(), LLONG_CONST, and mTime.

Referenced by isoFormat().

◆ isZero()

bool CCopasiTimeVariable::isZero ( ) const
Returns
boolean indicating whether the underlying value is 0

References mTime.

◆ LL2String()

std::string CCopasiTimeVariable::LL2String ( const C_INT64 value,
const C_INT32 digits = 0 
)
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.

Parameters
constC_INT64 & value
constC_INT32 & digits (default: 0)
Returns
std::string

References StringPrint().

Referenced by isoFormat(), COptProblem::printResult(), and CFitProblem::printResult().

◆ operator+()

CCopasiTimeVariable CCopasiTimeVariable::operator+ ( const CCopasiTimeVariable value)

Operator + for adding CCopasiTimeVariables

Parameters
constCCopasiTimeVariable & value
Returns
CCopasiTimeVariable sum

References mTime.

◆ operator-()

CCopasiTimeVariable CCopasiTimeVariable::operator- ( const CCopasiTimeVariable value)

Operator - for subtracting CCopasiTimeVariables

Parameters
constCCopasiTimeVariable & value
Returns
CCopasiTimeVariable difference

References mTime.

◆ operator<()

bool CCopasiTimeVariable::operator< ( const CCopasiTimeVariable value)

Coparison operator <

Parameters
constCCopasiTimeVariable & value
Returns
bool isLess

References mTime.

◆ operator=() [1/2]

CCopasiTimeVariable & CCopasiTimeVariable::operator= ( const C_INT64 value)

Assignement operator assigning a C_INT64 value to a CCopasiTimeVariable

Parameters
constCCopasiTimeVariable & rhs
Returns
CCopasiTimeVariable & this

References mTime.

◆ operator=() [2/2]

CCopasiTimeVariable & CCopasiTimeVariable::operator= ( const CCopasiTimeVariable rhs)

Assignement operator

Parameters
constCCopasiTimeVariable & rhs
Returns
CCopasiTimeVariable & this

References mTime.

Member Data Documentation

◆ mTime

C_INT64 CCopasiTimeVariable::mTime
private

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