1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2002 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
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. *
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. *
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. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _STATINTONCEELEM_H_
40 #define _STATINTONCEELEM_H_
45 #include "OSGStatElem.h"
49 #include "OSGDeprecatedCPP.h"
54 class StatElemDescBase
;
56 /*! \brief Time Statistics element, see \ref PageSystemStatistics for details.
57 \ingroup GrpBaseStatistics
58 \ingroup GrpLibOSGBase
61 class OSG_BASE_DLLMAPPING StatIntOnceElem
: public StatElem
64 /*========================== PUBLIC =================================*/
68 typedef OSG_HASH_SET(UInt32
) IdHash
;
70 /*---------------------------------------------------------------------*/
71 /*! \name your_category */
74 static StatElem
*create(StatElemDescBase
*desc
);
77 /*---------------------------------------------------------------------*/
81 virtual void reset(void );
83 void add (UInt32 contributorId
,
85 void sub (UInt32 contributorId
,
88 void inc (UInt32 contributorId
);
89 void dec (UInt32 contributorId
);
91 Int64
get (void ) const;
94 /*---------------------------------------------------------------------*/
98 virtual void putToString ( std::string
& str
,
99 const std::string
&format
= std::string()) const;
101 virtual bool getFromCString(const Char8
*&inVal
);
103 virtual Real64
getValue ( void ) const;
106 /*---------------------------------------------------------------------*/
107 /*! \name comparison */
110 bool operator < (const StatIntOnceElem
&other
) const;
113 /*---------------------------------------------------------------------*/
114 /*! \name Creation */
117 virtual StatElem
*clone(void) const;
120 /*---------------------------------------------------------------------*/
121 /*! \name Operators */
124 virtual StatElem
&operator += (const StatElem
&other
);
127 /*========================= PROTECTED ===============================*/
131 /*---------------------------------------------------------------------*/
132 /*! \name Constructors */
135 StatIntOnceElem(StatElemDescBase
*desc
);
137 virtual ~StatIntOnceElem(void);
140 /*========================= PRIVATE ===============================*/
143 typedef StatElem Inherited
;
149 // prohibit default functions (move to 'public' if you need one)
150 StatIntOnceElem (const StatIntOnceElem
&source
);
151 StatIntOnceElem
& operator =(const StatIntOnceElem
&source
);
154 //---------------------------------------------------------------------------
156 //---------------------------------------------------------------------------
158 typedef StatIntOnceElem
*StatIntOnceElemP
;
162 #include "OSGStatIntOnceElem.inl"
164 #endif /* _STATINTONCEELEM_H_ */