18 INLINE ConfigVariable::
19 ConfigVariable(
const std::string &name, ConfigVariable::ValueType value_type) :
28 INLINE ConfigVariable::
29 ConfigVariable(
const std::string &name, ConfigVariable::ValueType value_type,
30 const std::string &description,
int flags) :
40 INLINE ConfigVariable::
41 ConfigVariable(
const std::string &name) :
50 INLINE ConfigVariable::
59 get_default_value()
const {
60 nassertr(is_constructed(),
nullptr);
61 return _core->get_default_value();
69 nassertr(is_constructed(), *
new std::string());
81 nassertv(is_constructed());
82 _core->make_local_value()->set_string_value(string_value);
91 nassertv(is_constructed());
92 _core->clear_local_value();
101 nassertr(is_constructed(), 0);
111 INLINE
bool ConfigVariable::
112 has_string_word(
size_t n)
const {
113 nassertr(is_constructed(),
false);
122 INLINE
bool ConfigVariable::
123 has_bool_word(
size_t n)
const {
124 nassertr(is_constructed(),
false);
133 INLINE
bool ConfigVariable::
134 has_int_word(
size_t n)
const {
135 nassertr(is_constructed(),
false);
144 INLINE
bool ConfigVariable::
145 has_int64_word(
size_t n)
const {
146 nassertr(is_constructed(),
false);
155 INLINE
bool ConfigVariable::
156 has_double_word(
size_t n)
const {
157 nassertr(is_constructed(),
false);
166 INLINE std::string ConfigVariable::
167 get_string_word(
size_t n)
const {
168 nassertr(is_constructed(), std::string());
177 INLINE
bool ConfigVariable::
178 get_bool_word(
size_t n)
const {
179 nassertr(is_constructed(),
false);
188 INLINE
int ConfigVariable::
189 get_int_word(
size_t n)
const {
190 nassertr(is_constructed(), 0);
199 INLINE int64_t ConfigVariable::
200 get_int64_word(
size_t n)
const {
201 nassertr(is_constructed(), 0);
210 INLINE
double ConfigVariable::
211 get_double_word(
size_t n)
const {
212 nassertr(is_constructed(), 0.0);
221 INLINE
void ConfigVariable::
222 set_string_word(
size_t n,
const std::string &value) {
223 nassertv(is_constructed());
224 _core->make_local_value()->set_string_word(n, value);
231 INLINE
void ConfigVariable::
232 set_bool_word(
size_t n,
bool value) {
233 nassertv(is_constructed());
234 _core->make_local_value()->set_bool_word(n, value);
241 INLINE
void ConfigVariable::
242 set_int_word(
size_t n,
int value) {
243 nassertv(is_constructed());
244 _core->make_local_value()->set_int_word(n, value);
251 INLINE
void ConfigVariable::
252 set_int64_word(
size_t n, int64_t value) {
253 nassertv(is_constructed());
254 _core->make_local_value()->set_int64_word(n, value);
261 INLINE
void ConfigVariable::
262 set_double_word(
size_t n,
double value) {
263 nassertv(is_constructed());
264 _core->make_local_value()->set_double_word(n, value);
273 INLINE
bool ConfigVariable::
274 is_constructed()
const {
276 if (_core ==
nullptr) {
277 report_unconstructed();