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 //---------------------------------------------------------------------------
41 //---------------------------------------------------------------------------
46 #include "OSGConfig.h"
48 #include "OSGStatElem.h"
53 /***************************************************************************\
55 \***************************************************************************/
57 /*! \class OSG::StatElem
59 The StatElem is the abstract base class for all the data types that can be
60 recorded statistically. See \ref PageSystemStatistics for an overview of the
64 It mainly provides the general interfaces for accessing the statistics data
65 as a Real64 value via getValue, if possible, and in ASCII via the
66 putToString and getFromString methods. Additionally every StatElem can be
67 switched on or off, to prevent collecting statistics that is not needed,
68 via the setOn methods.
69 Finally, ever StatElem can give information about itself in the form of a
74 To add a new StatElem type the given interface has to be implemented.
75 There are no restrictions as to which types are possible, as long as they
76 can be converted to and from a string. See StatIntElem for a simple example.
82 /*! \fn void OSG::StatElem::putToString( std::string &str,
83 const std::string &format) const
85 The putToString method converts the value of the StatElem into a standard
88 The conversion can be parameterized by the format string parameter. It is
89 modelled after the printf()-format string. It typically should contain a
90 single "%" value to format the contents of the StatElem.
94 /***************************************************************************\
96 \***************************************************************************/
98 /*-------------------------------------------------------------------------*\
100 \*-------------------------------------------------------------------------*/
102 /*------------- constructors & destructors --------------------------------*/
104 StatElem::StatElem(StatElemDescBase
*desc
) :
110 StatElem::~StatElem(void)
114 /*-------------------------- assignment -----------------------------------*/
116 StatElem
&StatElem::operator = (const StatElem
&source
)
124 _desc
= source
._desc
;
129 /*-------------------------- comparison -----------------------------------*/
131 /*! Comparison. This does not compare the actual values of the StatElem, as
132 that may not be possible for all types.
135 bool StatElem::operator < (const StatElem
&other
) const
137 return this < &other
;