fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / Statistics / OSGStatTimeStampElem.h
blob93782cb65bcd1900eaced66135916d8eecea1b18
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
18 * *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _STATTIMESTAMPELEM_H_
40 #define _STATTIMESTAMPELEM_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
46 #include "OSGStatElem.h"
48 #include "OSGTime.h"
50 OSG_BEGIN_NAMESPACE
52 class StatElemDescBase;
54 /*! \brief Time Statistics element, see \ref PageSystemStatistics for details.
55 \ingroup GrpBaseStatistics
56 \ingroup GrpLibOSGBase
59 class OSG_BASE_DLLMAPPING StatTimeStampElem : public StatElem
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name your_category */
68 /*! \{ */
70 static StatElem *create(StatElemDescBase *desc);
72 /*! \} */
73 /*---------------------------------------------------------------------*/
74 /*! \name instance */
75 /*! \{ */
77 virtual void reset (void);
79 const TimeStamp &start (void);
81 const TimeStamp &stop (void);
83 const TimeStamp &getTime(void) const;
85 /*! \} */
86 /*---------------------------------------------------------------------*/
87 /*! \name instance */
88 /*! \{ */
90 virtual void putToString ( std::string & str,
91 const std::string &format = std::string()) const;
93 virtual bool getFromCString(const Char8 *&inVal );
95 virtual Real64 getValue (void ) const;
97 /*! \} */
98 /*---------------------------------------------------------------------*/
99 /*! \name comparison */
100 /*! \{ */
102 bool operator < (const StatTimeStampElem &other) const;
104 /*! \} */
105 /*---------------------------------------------------------------------*/
106 /*! \name Creation */
107 /*! \{ */
109 virtual StatElem *clone(void) const;
111 /*! \} */
112 /*---------------------------------------------------------------------*/
113 /*! \name Operators */
114 /*! \{ */
116 virtual StatElem &operator += (const StatElem &other);
118 /*! \} */
119 /*========================= PROTECTED ===============================*/
121 protected:
123 /*---------------------------------------------------------------------*/
124 /*! \name Constructors */
125 /*! \{ */
127 StatTimeStampElem(StatElemDescBase *desc);
129 virtual ~StatTimeStampElem(void);
131 /*! \} */
132 /*========================= PRIVATE ===============================*/
134 private:
136 typedef StatElem Inherited;
138 TimeStamp _time;
140 // prohibit default functions (move to 'public' if you need one)
141 StatTimeStampElem (const StatTimeStampElem &source);
142 StatTimeStampElem& operator =(const StatTimeStampElem &source);
145 //---------------------------------------------------------------------------
146 // Exported Types
147 //---------------------------------------------------------------------------
149 typedef StatTimeStampElem *StatTimeStampElemP;
151 OSG_END_NAMESPACE
153 #include "OSGStatTimeStampElem.inl"
155 #endif /* _STATTIMESTAMPELEM_H_ */