21 template<
class EnumType>
24 const string &description,
int flags) :
25 #ifdef PRC_SAVE_DESCRIPTIONS
30 _got_default_value(true),
31 _default_value(default_value),
32 _local_modified(initial_invalid_cache())
34 _core->set_default_value(format_enum(default_value));
43 template<
class EnumType>
46 const string &description,
int flags) :
47 #ifdef PRC_SAVE_DESCRIPTIONS
52 _got_default_value(true),
53 _default_value(parse_string(default_value)),
54 _local_modified(initial_invalid_cache())
56 _core->set_default_value(default_value);
65 template<
class EnumType>
75 template<
class EnumType>
86 template<
class EnumType>
88 operator EnumType ()
const {
97 template<
class EnumType>
100 return get_num_words();
108 template<
class EnumType>
119 template<
class EnumType>
122 set_string_value(format_enum(value));
130 template<
class EnumType>
133 TAU_PROFILE(
"EnumType ConfigVariableEnum<EnumType>::get_value() const",
" ", TAU_USER);
134 if (!is_cache_valid(_local_modified)) {
146 template<
class EnumType>
149 if (!_got_default_value) {
156 return _default_value;
164 template<
class EnumType>
167 return (EnumType)parse_string(get_string_word(n));
176 template<
class EnumType>
179 set_string_word(n, format_enum(value));
189 template<
class EnumType>
205 template<
class EnumType>
EnumType get_default_value() const
Returns the variable's default value.
The internal definition of a ConfigVariable.
const string & get_string_value() const
Returns the value assigned to this variable.
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.
const ConfigDeclaration * get_default_value() const
Returns the default variable specified for this variable.
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.
A single declaration of a config variable, typically defined as one line in a .prc file...