Panda3D
Loading...
Searching...
No Matches
configVariableBool.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 configVariableBool.h
10 * @author drose
11 * @date 2004-10-20
12 */
13
14#ifndef CONFIGVARIABLEBOOL_H
15#define CONFIGVARIABLEBOOL_H
16
17#include "dtoolbase.h"
18#include "configVariable.h"
19
20/**
21 * This is a convenience class to specialize ConfigVariable as a boolean type.
22 */
23class EXPCL_DTOOL_PRC ConfigVariableBool : public ConfigVariable {
24PUBLISHED:
25 INLINE ConfigVariableBool(const std::string &name);
26 INLINE ConfigVariableBool(const std::string &name, bool default_value,
27 const std::string &description = std::string(), int flags = 0);
28 INLINE ConfigVariableBool(const std::string &name, const std::string &default_value,
29 const std::string &description = std::string(), int flags = 0);
30
31 INLINE void operator = (bool value);
32 ALWAYS_INLINE operator bool () const;
33
34 INLINE size_t size() const;
35 INLINE bool operator [] (size_t n) const;
36
37 INLINE void set_value(bool value);
38 ALWAYS_INLINE bool get_value() const;
39 INLINE bool get_default_value() const;
40 MAKE_PROPERTY(value, get_value, set_value);
41 MAKE_PROPERTY(default_value, get_default_value);
42
43 INLINE bool get_word(size_t n) const;
44 INLINE void set_word(size_t n, bool value);
45
46private:
47 void reload_value() const;
48
49 mutable AtomicAdjust::Integer _local_modified;
50 mutable bool _cache;
51};
52
53#include "configVariableBool.I"
54
55#endif
get_value
Returns the variable's value.
size_t size() const
Returns the number of unique words in the variable.
set_value
Reassigns the variable's local value.
get_default_value
Returns the variable's default value.
void set_word(size_t n, bool value)
Reassigns the variable's nth value.
bool get_word(size_t n) const
Returns the variable's nth value.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.