Panda3D

Loading...
Searching...
No Matches
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 {
25PUBLISHED:
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::set_value
set_value
Reassigns the variable's local value.
Definition configVariableDouble.h:43
ConfigVariableDouble::get_word
double get_word(size_t n) const
Returns the variable's nth value.
Definition configVariableDouble.I:129
ConfigVariableDouble::get_value
get_value
Returns the variable's value.
Definition configVariableDouble.h:43
ConfigVariableDouble::get_default_value
get_default_value
Returns the variable's default value.
Definition configVariableDouble.h:44
ConfigVariableDouble::set_word
void set_word(size_t n, double value)
Reassigns the variable's nth value.
Definition configVariableDouble.I:138
ConfigVariableDouble::size
size_t size() const
Returns the number of unique words in the variable.
Definition configVariableDouble.I:79
configVariableDouble.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
configVariable.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
dtoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.