forked from panda3d/panda3d
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigVariableInt.h
More file actions
59 lines (48 loc) · 1.64 KB
/
configVariableInt.h
File metadata and controls
59 lines (48 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
* PANDA 3D SOFTWARE
* Copyright (c) Carnegie Mellon University. All rights reserved.
*
* All use of this software is subject to the terms of the revised BSD
* license. You should have received a copy of this license along
* with this source code in a file named "LICENSE."
*
* @file configVariableInt.h
* @author drose
* @date 2004-10-20
*/
#ifndef CONFIGVARIABLEINT_H
#define CONFIGVARIABLEINT_H
#include "dtoolbase.h"
#include "configVariable.h"
/**
* This is a convenience class to specialize ConfigVariable as an integer
* type.
*/
class EXPCL_DTOOL_PRC ConfigVariableInt : public ConfigVariable {
PUBLISHED:
INLINE ConfigVariableInt(const std::string &name);
INLINE ConfigVariableInt(const std::string &name, int default_value,
const std::string &description = std::string(),
int flags = 0);
INLINE ConfigVariableInt(const std::string &name, const std::string &default_value,
const std::string &description = std::string(),
int flags = 0);
INLINE void operator = (int value);
INLINE operator int () const;
INLINE size_t size() const;
INLINE int operator [] (size_t n) const;
INLINE void set_value(int value);
INLINE int get_value() const;
INLINE int get_default_value() const;
MAKE_PROPERTY(value, get_value, set_value);
MAKE_PROPERTY(default_value, get_default_value);
INLINE int get_word(size_t n) const;
INLINE void set_word(size_t n, int value);
private:
void set_default_value(int default_value);
private:
AtomicAdjust::Integer _local_modified;
int _cache;
};
#include "configVariableInt.I"
#endif