Panda3D
configVariableDouble.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file configVariableDouble.h
10  * @author drose
11  * @date 2004-10-20
12  */
13 
14 #ifndef CONFIGVARIABLEDOUBLE_H
15 #define CONFIGVARIABLEDOUBLE_H
16 
17 #include "dtoolbase.h"
18 #include "configVariable.h"
19 
20 /**
21  * This is a convenience class to specialize ConfigVariable as a floating-
22  * point type.
23  */
24 class EXPCL_DTOOL_PRC ConfigVariableDouble : public ConfigVariable {
25 PUBLISHED:
26  INLINE ConfigVariableDouble(const std::string &name);
27  INLINE ConfigVariableDouble(const std::string &name, double default_value,
28  const std::string &description = std::string(),
29  int flags = 0);
30  INLINE ConfigVariableDouble(const std::string &name, const std::string &default_value,
31  const std::string &description = std::string(),
32  int flags = 0);
33 
34  INLINE void operator = (double value);
35  INLINE operator double () const;
36 
37  INLINE size_t size() const;
38  INLINE double operator [] (size_t n) const;
39 
40  INLINE void set_value(double value);
41  INLINE double get_value() const;
42  INLINE double get_default_value() const;
43  MAKE_PROPERTY(value, get_value, set_value);
44  MAKE_PROPERTY(default_value, get_default_value);
45 
46  INLINE double get_word(size_t n) const;
47  INLINE void set_word(size_t 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
configVariableDouble.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dtoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
configVariable.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
ConfigVariableDouble
This is a convenience class to specialize ConfigVariable as a floating- point type.
Definition: configVariableDouble.h:24
ConfigVariable
This is a generic, untyped ConfigVariable.
Definition: configVariable.h:31