changed: auto add updateData callback to stages so that stagedata can be updated...
[opensg.git] / Source / Base / Statistics / OSGStatElem.h
blob328247829e76b8c23bc0a31ddeac9a47f4540fd8
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 \*---------------------------------------------------------------------------*/
40 #ifndef _OSGSTATELEM_H_
41 #define _OSGSTATELEM_H_
42 #ifdef __sgi
43 #pragma once
44 #endif
46 #include "OSGBaseTypes.h"
48 #include <string>
50 OSG_BEGIN_NAMESPACE
52 class StatElemDescBase;
54 /*! \brief Single Statistics element, see \ref PageSystemStatistics for
55 details.
56 \ingroup GrpBaseStatistics
57 \ingroup GrpLibOSGBase
60 class OSG_BASE_DLLMAPPING StatElem
62 /*========================== PUBLIC =================================*/
64 public:
66 /*---------------------------------------------------------------------*/
67 /*! \name Instance */
68 /*! \{ */
70 bool isOn (void ) const;
71 void setOn (bool on);
73 StatElemDescBase *getDesc(void ) const;
75 /*! \} */
76 /*---------------------------------------------------------------------*/
77 /*! \name Destructor */
78 /*! \{ */
80 virtual void putToString ( std::string &str,
81 const std::string &format = std::string()) const = 0;
83 virtual bool getFromCString(const Char8 *&inVal ) = 0;
85 virtual Real64 getValue (void ) const = 0;
87 virtual void reset (void ) = 0;
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Destructor */
92 /*! \{ */
94 virtual ~StatElem(void);
96 /*! \} */
97 /*---------------------------------------------------------------------*/
98 /*! \name Comparison */
99 /*! \{ */
101 bool operator < (const StatElem &other) const;
103 /*! \} */
104 /*---------------------------------------------------------------------*/
105 /*! \name Creation */
106 /*! \{ */
108 virtual StatElem *clone(void) const = 0;
110 /*! \} */
111 /*---------------------------------------------------------------------*/
112 /*! \name Operators */
113 /*! \{ */
115 virtual StatElem &operator += (const StatElem &other) = 0;
117 /*! \} */
118 /*========================= PROTECTED ===============================*/
120 protected:
122 StatElem (StatElemDescBase *desc);
124 /*========================== PRIVATE ================================*/
126 private:
128 bool _on;
129 StatElemDescBase *_desc;
131 // prohibit default functions (move to 'public' if you need one)
133 StatElem (const StatElem &source);
134 StatElem& operator =(const StatElem &source);
137 typedef StatElem *StatElemP;
139 OSG_END_NAMESPACE
141 #include "OSGStatElem.inl"
143 #endif /* _OSGSTATELEM_H_ */