COPASI API
4.40.278
|
#include <CDataTimer.h>
Public Types | |
enum class | Type { WALL = 0 , PROCESS , THREAD , CURRENT , __SIZE } |
Public Types inherited from CDataObject | |
typedef std::set< const CDataObject * > | DataObjectSet |
enum | Flag { Container , Vector , Matrix , NameVector , Reference , ValueBool , ValueInt , ValueInt64 , ValueDbl , NonUniqueName , StaticString , ValueString , Separator , DisplayName , ModelEntity , Array , DataModel , Root , Gui , __SIZE } |
Public Types inherited from CObjectInterface | |
typedef std::vector< const CDataContainer * > | ContainerList |
typedef std::set< const CObjectInterface * > | ObjectSet |
Public Member Functions | |
virtual void | calculateValue () override |
CCopasiTimer (const CCopasiTimer &src, const CDataContainer *pParent) | |
CCopasiTimer (const Type &type=Type::WALL, const CDataContainer *pParent=NO_PARENT) | |
const CCopasiTimeVariable & | getElapsedTime () const |
const C_FLOAT64 & | getElapsedTimeSeconds () const |
virtual void * | getValuePointer () const override |
virtual void | print (std::ostream *ostream) const override |
bool | start () |
~CCopasiTimer () | |
Public Member Functions inherited from CDataObject | |
void | addIssue (const CIssue &issue) |
void | addReference (const CDataContainer *pReference) |
virtual bool | applyData (const CData &data, CUndoData::CChangeSet &changes) override |
CDataObject (const CDataObject &src, const CDataContainer *pParent=NULL) | |
virtual void | createUndoData (CUndoData &undoData, const CUndoData::Type &type, const CData &oldData=CData(), const CCore::Framework &framework=CCore::Framework::ParticleNumbers) const override |
virtual void | destruct () override |
virtual CCommonName | getCN () const override |
virtual const CDataObject * | getDataObject () const override |
virtual const std::string & | getKey () const |
virtual const CObjectInterface * | getObject (const CCommonName &cn) const override |
CDataContainer * | getObjectAncestor (const std::string &type) const |
CDataModel * | getObjectDataModel () const |
virtual std::string | getObjectDisplayName () const override |
const CObjectInterface * | getObjectFromCN (const CCommonName &cn) const |
const std::string & | getObjectName () const |
CDataContainer * | getObjectParent () const |
const std::string & | getObjectType () const |
virtual const CObjectInterface::ObjectSet & | getPrerequisites () const override |
virtual const std::string | getUnits () const |
virtual const CValidity & | getValidity () const override |
virtual const CDataObject * | getValueObject () const |
bool | hasFlag (const Flag &flag) const |
virtual bool | isPrerequisiteForContext (const CObjectInterface *pObject, const CCore::SimulationContextFlag &context, const CObjectInterface::ObjectSet &changedObjects) const override |
bool | prerequisitsContains (const DataObjectSet &objects) const |
void | removeIssue (const CIssue &issue) |
void | removeReference (const CDataContainer *pReference) |
bool | setObjectName (const std::string &name) |
virtual bool | setObjectParent (const CDataContainer *pParent) |
virtual CData | toData () const override |
void | validityChanged (const CValidity &changedValidity) override |
void | validityRemoved (const CValidity &changedValidity) |
virtual | ~CDataObject () |
Public Member Functions inherited from CObjectInterface | |
CObjectInterface () | |
CObjectInterface (const CObjectInterface &src) | |
virtual | ~CObjectInterface () |
Public Member Functions inherited from CUndoObjectInterface | |
CUndoObjectInterface () | |
CUndoObjectInterface (const CUndoObjectInterface &src) | |
bool | generateUuid () |
const xg::Guid & | getUuid () const |
virtual CUndoObjectInterface * | insert (const CData &data) |
bool | setUuid (const std::string &uuid) |
bool | setUuid (const xg::Guid &uuid) |
virtual void | updateIndex (const size_t &index, const CUndoObjectInterface *pUndoObject) |
virtual | ~CUndoObjectInterface () |
Private Attributes | |
CCopasiTimeVariable | mElapsedTime |
C_FLOAT64 | mElapsedTimeSeconds |
CCopasiTimeVariable | mStartTime |
Type | mType |
Additional Inherited Members | |
Static Public Member Functions inherited from CDataObject | |
static CDataObject * | fromData (const CData &data, CUndoObjectInterface *pParent) |
static void | sanitizeObjectName (std::string &name) |
Static Public Member Functions inherited from CObjectInterface | |
static const CDataObject * | DataObject (const CObjectInterface *pInterface) |
static CObjectInterface * | GetObjectFromCN (const ContainerList &listOfContainer, const CCommonName &objName) |
Static Public Member Functions inherited from CUndoObjectInterface | |
template<class CType > | |
static CType * | fromData (const CData &, CUndoObjectInterface *) |
Protected Member Functions inherited from CDataObject | |
CDataObject () | |
CDataObject (const std::string &name, const CDataContainer *pParent=static_cast< CDataContainer * >((void *) 0), const std::string &type="CN", const CFlags< Flag > &flag=CFlags< Flag >::None) | |
Protected Attributes inherited from CDataObject | |
ObjectSet | mPrerequisits |
std::set< CDataContainer * > | mReferences |
Protected Attributes inherited from CObjectInterface | |
CValidity | mValidity |
|
strong |
CCopasiTimer::CCopasiTimer | ( | const Type & | type = Type::WALL , |
const CDataContainer * | pParent = NO_PARENT |
||
) |
Default constructor
const | Type & type (default: WALL) |
const | CDataContainer * pParent (default: NULL) |
References CURRENT, CCopasiTimeVariable::getCurrentWallTime(), CCopasiTimeVariable::getProcessTime(), CCopasiTimeVariable::getThreadTime(), mStartTime, mType, PROCESS, THREAD, and WALL.
CCopasiTimer::CCopasiTimer | ( | const CCopasiTimer & | src, |
const CDataContainer * | pParent | ||
) |
Copy constructor
const | CCopasiTimer & src |
const | CDataContainer * pParent (default: NULL) |
CCopasiTimer::~CCopasiTimer | ( | ) |
Destructor.
|
overridevirtual |
Calculate the objects value.
Reimplemented from CDataObject.
References CURRENT, CCopasiTimeVariable::getCurrentWallTime(), CCopasiTimeVariable::getMicroSeconds(), CCopasiTimeVariable::getProcessTime(), CCopasiTimeVariable::getThreadTime(), mElapsedTime, mElapsedTimeSeconds, mStartTime, mType, PROCESS, THREAD, and WALL.
Referenced by COptProblem::calculateStatistics(), and CFitProblem::calculateStatistics().
const CCopasiTimeVariable & CCopasiTimer::getElapsedTime | ( | ) | const |
Retrieve the elapsed time.
References mElapsedTime.
Referenced by COptProblem::printResult(), and CFitProblem::printResult().
const C_FLOAT64 & CCopasiTimer::getElapsedTimeSeconds | ( | ) | const |
Retrieve the elapsed time in seconds.
References mElapsedTimeSeconds.
Referenced by COptProblem::getExecutionTime().
|
overridevirtual |
Retrieve a pointer to the value of the object
Reimplemented from CDataObject.
References mElapsedTimeSeconds.
|
overridevirtual |
This is the output method for any object. The default implementation provided with CDataObject uses the ostream operator<< of the object to print the object. To override this default behavior one needs to reimplement the virtual print function.
std::ostream | * ostream |
Reimplemented from CDataObject.
References CURRENT, mElapsedTimeSeconds, mType, PROCESS, THREAD, UTCTimeStamp(), and WALL.
bool CCopasiTimer::start | ( | ) |
Start or restart the timer.
References CURRENT, CCopasiTimeVariable::getCurrentWallTime(), CCopasiTimeVariable::getProcessTime(), CCopasiTimeVariable::getThreadTime(), mElapsedTime, mElapsedTimeSeconds, mStartTime, mType, PROCESS, THREAD, and WALL.
Referenced by COptProblem::initialize().
|
private |
The elapsed time of the timer.
Referenced by calculateValue(), getElapsedTime(), and start().
|
private |
The elapsed time as a double used for reporting.
Referenced by calculateValue(), getElapsedTimeSeconds(), getValuePointer(), print(), and start().
|
private |
The start time of the timer.
Referenced by calculateValue(), CCopasiTimer(), and start().
|
private |
The timer type
Referenced by calculateValue(), CCopasiTimer(), print(), and start().