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