17 template<
class EnumType>
20 const std::string &description,
int flags) :
21 #ifdef PRC_SAVE_DESCRIPTIONS
26 _got_default_value(true),
27 _default_value(default_value),
28 _local_modified(initial_invalid_cache())
30 _core->set_default_value(format_enum(default_value));
37 template<
class EnumType>
40 const std::string &description,
int flags) :
41 #ifdef PRC_SAVE_DESCRIPTIONS
46 _got_default_value(true),
47 _default_value(parse_string(default_value)),
48 _local_modified(initial_invalid_cache())
50 _core->set_default_value(default_value);
57 template<
class EnumType>
65 template<
class EnumType>
74 template<
class EnumType>
76 operator EnumType ()
const {
83 template<
class EnumType>
86 return get_num_words();
92 template<
class EnumType>
101 template<
class EnumType>
104 set_string_value(format_enum(value));
110 template<
class EnumType>
113 TAU_PROFILE(
"EnumType ConfigVariableEnum<EnumType>::get_value() const",
" ", TAU_USER);
114 if (!is_cache_valid(_local_modified)) {
124 template<
class EnumType>
127 if (!_got_default_value) {
129 if (decl !=
nullptr) {
134 return _default_value;
140 template<
class EnumType>
143 return (EnumType)parse_string(get_string_word(n));
150 template<
class EnumType>
153 set_string_word(n, format_enum(value));
160 template<
class EnumType>
163 std::istringstream strm(value);
174 template<
class EnumType>
177 std::ostringstream strm;
const std::string & get_string_value() const
Returns the value assigned to this variable.
The internal definition of a ConfigVariable.
size_t size() const
Returns the number of unique words in the variable.
void operator=(EnumType value)
Reassigns the variable's local value.
This is a generic, untyped ConfigVariable.
This class specializes ConfigVariable as an enumerated type.
void set_word(size_t n, EnumType value)
Reassigns the variable's nth value.
EnumType operator [](size_t n) const
Returns the value of the variable's nth word.
EnumType get_word(size_t n) const
Returns the variable's nth value.
A single declaration of a config variable, typically defined as one line in a .prc file,...
set_value
Reassigns the variable's local value.