15 #ifndef CONFIGVARIABLEENUM_H
16 #define CONFIGVARIABLEENUM_H
18 #include "dtoolbase.h"
19 #include "configVariable.h"
34 template<
class EnumType>
38 const string &description =
string(),
40 INLINE ConfigVariableEnum(
const string &name,
const string &default_value,
41 const string &description =
string(),
43 INLINE ~ConfigVariableEnum();
46 INLINE
operator EnumType ()
const;
48 INLINE
int size()
const;
55 INLINE EnumType
get_word(
int n)
const;
56 INLINE
void set_word(
int n, EnumType value);
59 INLINE EnumType parse_string(
const string &value)
const;
60 INLINE
string format_enum(EnumType value)
const;
63 bool _got_default_value;
64 EnumType _default_value;
66 AtomicAdjust::Integer _local_modified;
70 #include "configVariableEnum.I"
EnumType get_default_value() const
Returns the variable's default value.
EnumType get_word(int n) const
Returns the variable's nth value.
void operator=(EnumType value)
Reassigns the variable's local value.
void set_word(int n, EnumType value)
Reassigns the variable's nth value.
EnumType operator[](int n) const
Returns the value of the variable's nth word.
void set_value(EnumType value)
Reassigns the variable's local value.
This is a generic, untyped ConfigVariable.
int size() const
Returns the number of unique words in the variable.
This class specializes ConfigVariable as an enumerated type.
EnumType get_value() const
Returns the variable's value.