fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / Base / Statistics / OSGStatTimeElem.h
blobea7243e25af40883132fbcacc70177aaf9ed1fd8
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 _STATTIMEELEM_H_
40 #define _STATTIMEELEM_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 StatTimeElem : 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 Time &start (void);
80 const Time &stop (void);
81 const Time &getTime(void) const;
83 /*! \} */
84 /*---------------------------------------------------------------------*/
85 /*! \name instance */
86 /*! \{ */
88 virtual void putToString ( std::string &str,
89 const std::string &format = std::string()) const;
91 virtual bool getFromCString(const Char8 *&inVal );
93 virtual Real64 getValue ( void ) const;
95 /*! \} */
96 /*---------------------------------------------------------------------*/
97 /*! \name comparison */
98 /*! \{ */
100 bool operator < (const StatTimeElem &other) const;
102 /*! \} */
103 /*---------------------------------------------------------------------*/
104 /*! \name Creation */
105 /*! \{ */
107 virtual StatElem *clone(void) const;
109 /*! \} */
110 /*---------------------------------------------------------------------*/
111 /*! \name Operators */
112 /*! \{ */
114 virtual StatElem &operator += (const StatElem &other);
116 /*! \} */
117 /*========================= PROTECTED ===============================*/
119 protected:
121 /*---------------------------------------------------------------------*/
122 /*! \name Constructors */
123 /*! \{ */
125 StatTimeElem(StatElemDescBase *desc);
127 virtual ~StatTimeElem(void);
129 /*! \} */
130 /*========================= PRIVATE ===============================*/
132 private:
134 typedef StatElem Inherited;
136 Time _startTime;
137 Time _time;
139 // prohibit default functions (move to 'public' if you need one)
140 StatTimeElem (const StatTimeElem &source);
141 StatTimeElem& operator =(const StatTimeElem &source);
144 //---------------------------------------------------------------------------
145 // Exported Types
146 //---------------------------------------------------------------------------
148 typedef StatTimeElem *StatTimeElemP;
150 OSG_END_NAMESPACE
152 #include "OSGStatTimeElem.inl"
154 #endif /* _STATTIMEELEM_H_ */