Panda3D
 All Classes Functions Variables Enumerations
configVariableDouble.h
1 // Filename: configVariableDouble.h
2 // Created by: drose (20Oct04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef CONFIGVARIABLEDOUBLE_H
16 #define CONFIGVARIABLEDOUBLE_H
17 
18 #include "dtoolbase.h"
19 #include "configVariable.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : ConfigVariableDouble
23 // Description : This is a convenience class to specialize
24 // ConfigVariable as a floating-point type.
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_DTOOLCONFIG ConfigVariableDouble : public ConfigVariable {
27 PUBLISHED:
28  INLINE ConfigVariableDouble(const string &name);
29  INLINE ConfigVariableDouble(const string &name, double default_value,
30  const string &description = string(),
31  int flags = 0);
32  INLINE ConfigVariableDouble(const string &name, const string &default_value,
33  const string &description = string(),
34  int flags = 0);
35 
36  INLINE void operator = (double value);
37  INLINE operator double () const;
38 
39  INLINE int size() const;
40  INLINE double operator [] (int n) const;
41 
42  INLINE void set_value(double value);
43  INLINE double get_value() const;
44  INLINE double get_default_value() const;
45 
46  INLINE double get_word(int n) const;
47  INLINE void set_word(int n, double value);
48 
49 private:
50  void set_default_value(double default_value);
51 
52 private:
53  AtomicAdjust::Integer _local_modified;
54  double _cache;
55 };
56 
57 #include "configVariableDouble.I"
58 
59 #endif
const ConfigDeclaration * get_default_value() const
Returns the default variable specified for this variable.
This is a convenience class to specialize ConfigVariable as a floating-point type.
This is a generic, untyped ConfigVariable.