Panda3D
Loading...
Searching...
No Matches
configVariableInt.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 configVariableInt.h
10 * @author drose
11 * @date 2004-10-20
12 */
13
14#ifndef CONFIGVARIABLEINT_H
15#define CONFIGVARIABLEINT_H
16
17#include "dtoolbase.h"
18#include "configVariable.h"
19
20/**
21 * This is a convenience class to specialize ConfigVariable as an integer
22 * type.
23 */
24class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable {
25PUBLISHED:
26 INLINE ConfigVariableInt(const std::string &name);
27 INLINE ConfigVariableInt(const std::string &name, int default_value,
28 const std::string &description = std::string(),
29 int flags = 0);
30 INLINE ConfigVariableInt(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 = (int value);
35 INLINE operator int () const;
36
37 INLINE size_t size() const;
38 INLINE int operator [] (size_t n) const;
39
40 INLINE void set_value(int value);
41 INLINE int get_value() const;
42 INLINE int get_default_value() const;
43 MAKE_PROPERTY(value, get_value, set_value);
44 MAKE_PROPERTY(default_value, get_default_value);
45
46 INLINE int get_word(size_t n) const;
47 INLINE void set_word(size_t n, int value);
48
49private:
50 void set_default_value(int default_value);
51
52private:
53 AtomicAdjust::Integer _local_modified;
54 int _cache;
55};
56
57#include "configVariableInt.I"
58
59#endif
This is a convenience class to specialize ConfigVariable as an integer type.
This is a generic, untyped ConfigVariable.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.