COPASI API  4.40.278
CCopasiTimer Class Reference

#include <CDataTimer.h>

Inheritance diagram for CCopasiTimer:
[legend]

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 CCopasiTimeVariablegetElapsedTime () const
 
const C_FLOAT64getElapsedTimeSeconds () 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 CDataObjectgetDataObject () const override
 
virtual const std::string & getKey () const
 
virtual const CObjectInterfacegetObject (const CCommonName &cn) const override
 
CDataContainergetObjectAncestor (const std::string &type) const
 
CDataModelgetObjectDataModel () const
 
virtual std::string getObjectDisplayName () const override
 
const CObjectInterfacegetObjectFromCN (const CCommonName &cn) const
 
const std::string & getObjectName () const
 
CDataContainergetObjectParent () const
 
const std::string & getObjectType () const
 
virtual const CObjectInterface::ObjectSetgetPrerequisites () const override
 
virtual const std::string getUnits () const
 
virtual const CValiditygetValidity () const override
 
virtual const CDataObjectgetValueObject () 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 CUndoObjectInterfaceinsert (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 CDataObjectfromData (const CData &data, CUndoObjectInterface *pParent)
 
static void sanitizeObjectName (std::string &name)
 
- Static Public Member Functions inherited from CObjectInterface
static const CDataObjectDataObject (const CObjectInterface *pInterface)
 
static CObjectInterfaceGetObjectFromCN (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
 

Member Enumeration Documentation

◆ Type

enum CCopasiTimer::Type
strong

Enumeration of timer types

Enumerator
WALL 
PROCESS 
THREAD 
CURRENT 
__SIZE 

Constructor & Destructor Documentation

◆ CCopasiTimer() [1/2]

CCopasiTimer::CCopasiTimer ( const Type type = Type::WALL,
const CDataContainer pParent = NO_PARENT 
)

Default constructor

Parameters
constType & type (default: WALL)
constCDataContainer * pParent (default: NULL)

References CURRENT, CCopasiTimeVariable::getCurrentWallTime(), CCopasiTimeVariable::getProcessTime(), CCopasiTimeVariable::getThreadTime(), mStartTime, mType, PROCESS, THREAD, and WALL.

◆ CCopasiTimer() [2/2]

CCopasiTimer::CCopasiTimer ( const CCopasiTimer src,
const CDataContainer pParent 
)

Copy constructor

Parameters
constCCopasiTimer & src
constCDataContainer * pParent (default: NULL)

◆ ~CCopasiTimer()

CCopasiTimer::~CCopasiTimer ( )

Destructor.

Member Function Documentation

◆ calculateValue()

◆ getElapsedTime()

const CCopasiTimeVariable & CCopasiTimer::getElapsedTime ( ) const

Retrieve the elapsed time.

Returns
const CCopasiTimeVariable & elapsedTime

References mElapsedTime.

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

◆ getElapsedTimeSeconds()

const C_FLOAT64 & CCopasiTimer::getElapsedTimeSeconds ( ) const

Retrieve the elapsed time in seconds.

Returns
const C_FLOAT64 & elapsedTimeSeconds

References mElapsedTimeSeconds.

Referenced by COptProblem::getExecutionTime().

◆ getValuePointer()

void * CCopasiTimer::getValuePointer ( ) const
overridevirtual

Retrieve a pointer to the value of the object

Reimplemented from CDataObject.

References mElapsedTimeSeconds.

◆ print()

void CCopasiTimer::print ( std::ostream *  ostream) const
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.

Parameters
std::ostream* ostream

Reimplemented from CDataObject.

References CURRENT, mElapsedTimeSeconds, mType, PROCESS, THREAD, UTCTimeStamp(), and WALL.

◆ start()

Member Data Documentation

◆ mElapsedTime

CCopasiTimeVariable CCopasiTimer::mElapsedTime
private

The elapsed time of the timer.

Referenced by calculateValue(), getElapsedTime(), and start().

◆ mElapsedTimeSeconds

C_FLOAT64 CCopasiTimer::mElapsedTimeSeconds
private

The elapsed time as a double used for reporting.

Referenced by calculateValue(), getElapsedTimeSeconds(), getValuePointer(), print(), and start().

◆ mStartTime

CCopasiTimeVariable CCopasiTimer::mStartTime
private

The start time of the timer.

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

◆ mType

Type CCopasiTimer::mType
private

The timer type

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


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