COPASI API  4.16.103
CCopasiTimer.h
Go to the documentation of this file.
1 /* Begin CVS Header
2  $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/report/CCopasiTimer.h,v $
3  $Revision: 1.9 $
4  $Name: $
5  $Author: shoops $
6  $Date: 2012/04/04 19:17:43 $
7  End CVS Header */
8 
9 // Copyright (C) 2012 - 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc. and EML Research, gGmbH.
16 // All rights reserved.
17 
18 #ifndef COPASI_CCopasiTimer
19 #define COPASI_CCopasiTimer
20 
21 #include "report/CCopasiObject.h"
22 #include "utilities/CopasiTime.h"
23 
25 {
26 public:
27  /**
28  * Enumeration of timer types
29  */
30  enum Type
31  {
32  WALL = 0,
35  };
36 
37  // Operations
38  /**
39  * Default constructor
40  * @param const Type & type (default: WALL)
41  * @param const CCopasiContainer * pParent (default: NULL)
42  */
43  CCopasiTimer(const Type & type = WALL,
44  const CCopasiContainer * pParent = NULL);
45 
46  /**
47  * Copy constructor
48  * @param const CCopasiTimer & src
49  * @param const CCopasiContainer * pParent (default: NULL)
50  */
51  CCopasiTimer(const CCopasiTimer & src,
52  const CCopasiContainer * pParent = NULL);
53 
54  /**
55  * Destructor.
56  */
57  ~CCopasiTimer();
58 
59  /**
60  * Start or restart the timer.
61  * @return bool success
62  */
63  bool start();
64 
65  /**
66  * Actualizes the timer.
67  */
68  void refresh();
69 
70  /**
71  * Retrieve the elapsed time.
72  * @return const CCopasiTimeVariable & elapsedTime
73  */
74  const CCopasiTimeVariable & getElapsedTime() const;
75 
76  /**
77  * Retrieve the elapsed time in seconds.
78  * @return const C_FLOAT64 & elapsedTimeSeconds
79  */
80  const C_FLOAT64 & getElapsedTimeSeconds() const;
81 
82  /**
83  * This is the output method for any object. The default implementation
84  * provided with CCopasiObject uses the ostream operator<< of the object
85  * to print the object. To override this default behavior one needs to
86  * reimplement the virtual print function.
87  * @param std::ostream * ostream
88  */
89  virtual void print(std::ostream * ostream) const;
90 
91  virtual void * getValuePointer() const;
92 
93 private:
94  // Attributes
95  /**
96  * The timer type
97  */
99 
100  /**
101  * The start time of the timer.
102  */
104 
105  /**
106  * The elapsed time of the timer.
107  */
109 
110  /**
111  * The elapsed time as a double used for reporting.
112  */
114 };
115 
116 #endif // COPASI_CCopasiTimer
C_FLOAT64 mElapsedTimeSeconds
Definition: CCopasiTimer.h:113
CCopasiTimeVariable mElapsedTime
Definition: CCopasiTimer.h:108
const CCopasiTimeVariable & getElapsedTime() const
CCopasiTimer(const Type &type=WALL, const CCopasiContainer *pParent=NULL)
const C_FLOAT64 & getElapsedTimeSeconds() const
CCopasiTimeVariable mStartTime
Definition: CCopasiTimer.h:103
virtual void * getValuePointer() const
#define C_FLOAT64
Definition: copasi.h:92
virtual void print(std::ostream *ostream) const