Panda3D
 All Classes Functions Variables Enumerations
configVariableInt.h
1 // Filename: configVariableInt.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 CONFIGVARIABLEINT_H
16 #define CONFIGVARIABLEINT_H
17 
18 #include "dtoolbase.h"
19 #include "configVariable.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : ConfigVariableInt
23 // Description : This is a convenience class to specialize
24 // ConfigVariable as an integer type.
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_DTOOLCONFIG ConfigVariableInt : public ConfigVariable {
27 PUBLISHED:
28  INLINE ConfigVariableInt(const string &name);
29  INLINE ConfigVariableInt(const string &name, int default_value,
30  const string &description = string(),
31  int flags = 0);
32  INLINE ConfigVariableInt(const string &name, const string &default_value,
33  const string &description = string(),
34  int flags = 0);
35 
36  INLINE void operator = (int value);
37  INLINE operator int () const;
38 
39  INLINE int size() const;
40  INLINE int operator [] (int n) const;
41 
42  INLINE void set_value(int value);
43  INLINE int get_value() const;
44  INLINE int get_default_value() const;
45 
46  INLINE int get_word(int n) const;
47  INLINE void set_word(int n, int value);
48 
49 private:
50  void set_default_value(int default_value);
51 
52 private:
53  AtomicAdjust::Integer _local_modified;
54  int _cache;
55 };
56 
57 #include "configVariableInt.I"
58 
59 #endif
const ConfigDeclaration * get_default_value() const
Returns the default variable specified for this variable.
This is a generic, untyped ConfigVariable.
This is a convenience class to specialize ConfigVariable as an integer type.