00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 INLINE ConfigVariable::
00023 ConfigVariable(const string &name, ConfigVariable::ValueType value_type) :
00024 ConfigVariableBase(name, value_type)
00025 {
00026 }
00027
00028
00029
00030
00031
00032
00033
00034 INLINE ConfigVariable::
00035 ConfigVariable(const string &name, ConfigVariable::ValueType value_type,
00036 const string &description, int flags) :
00037 ConfigVariableBase(name, value_type, description, flags)
00038 {
00039 }
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049 INLINE ConfigVariable::
00050 ConfigVariable(const string &name) :
00051 ConfigVariableBase(name, VT_undefined)
00052 {
00053 _core->set_used();
00054 }
00055
00056
00057
00058
00059
00060
00061 INLINE ConfigVariable::
00062 ~ConfigVariable() {
00063 }
00064
00065
00066
00067
00068
00069
00070
00071
00072 INLINE const ConfigDeclaration *ConfigVariable::
00073 get_default_value() const {
00074 nassertr(is_constructed(), (ConfigDeclaration *)NULL);
00075 return _core->get_default_value();
00076 }
00077
00078
00079
00080
00081
00082
00083
00084 INLINE const string &ConfigVariable::
00085 get_string_value() const {
00086 nassertr(is_constructed(), *new string());
00087 const ConfigDeclaration *decl = _core->get_declaration(0);
00088 return decl->get_string_value();
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 INLINE void ConfigVariable::
00100 set_string_value(const string &string_value) {
00101 nassertv(is_constructed());
00102 _core->make_local_value()->set_string_value(string_value);
00103 }
00104
00105
00106
00107
00108
00109
00110
00111
00112 INLINE void ConfigVariable::
00113 clear_value() {
00114 nassertv(is_constructed());
00115 _core->clear_local_value();
00116 }
00117
00118
00119
00120
00121
00122
00123
00124
00125 INLINE int ConfigVariable::
00126 get_num_words() const {
00127 nassertr(is_constructed(), 0);
00128 const ConfigDeclaration *decl = _core->get_declaration(0);
00129 return decl->get_num_words();
00130 }
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140 INLINE bool ConfigVariable::
00141 has_string_word(int n) const {
00142 nassertr(is_constructed(), false);
00143 const ConfigDeclaration *decl = _core->get_declaration(0);
00144 return decl->has_string_word(n);
00145 }
00146
00147
00148
00149
00150
00151
00152
00153 INLINE bool ConfigVariable::
00154 has_bool_word(int n) const {
00155 nassertr(is_constructed(), false);
00156 const ConfigDeclaration *decl = _core->get_declaration(0);
00157 return decl->has_bool_word(n);
00158 }
00159
00160
00161
00162
00163
00164
00165
00166 INLINE bool ConfigVariable::
00167 has_int_word(int n) const {
00168 nassertr(is_constructed(), false);
00169 const ConfigDeclaration *decl = _core->get_declaration(0);
00170 return decl->has_int_word(n);
00171 }
00172
00173
00174
00175
00176
00177
00178
00179 INLINE bool ConfigVariable::
00180 has_int64_word(int n) const {
00181 nassertr(is_constructed(), false);
00182 const ConfigDeclaration *decl = _core->get_declaration(0);
00183 return decl->has_int64_word(n);
00184 }
00185
00186
00187
00188
00189
00190
00191
00192 INLINE bool ConfigVariable::
00193 has_double_word(int n) const {
00194 nassertr(is_constructed(), false);
00195 const ConfigDeclaration *decl = _core->get_declaration(0);
00196 return decl->has_double_word(n);
00197 }
00198
00199
00200
00201
00202
00203
00204
00205
00206 INLINE string ConfigVariable::
00207 get_string_word(int n) const {
00208 nassertr(is_constructed(), string());
00209 const ConfigDeclaration *decl = _core->get_declaration(0);
00210 return decl->get_string_word(n);
00211 }
00212
00213
00214
00215
00216
00217
00218
00219
00220 INLINE bool ConfigVariable::
00221 get_bool_word(int n) const {
00222 nassertr(is_constructed(), false);
00223 const ConfigDeclaration *decl = _core->get_declaration(0);
00224 return decl->get_bool_word(n);
00225 }
00226
00227
00228
00229
00230
00231
00232
00233
00234 INLINE int ConfigVariable::
00235 get_int_word(int n) const {
00236 nassertr(is_constructed(), 0);
00237 const ConfigDeclaration *decl = _core->get_declaration(0);
00238 return decl->get_int_word(n);
00239 }
00240
00241
00242
00243
00244
00245
00246
00247
00248 INLINE PN_int64 ConfigVariable::
00249 get_int64_word(int n) const {
00250 nassertr(is_constructed(), 0);
00251 const ConfigDeclaration *decl = _core->get_declaration(0);
00252 return decl->get_int64_word(n);
00253 }
00254
00255
00256
00257
00258
00259
00260
00261
00262 INLINE double ConfigVariable::
00263 get_double_word(int n) const {
00264 nassertr(is_constructed(), 0.0);
00265 const ConfigDeclaration *decl = _core->get_declaration(0);
00266 return decl->get_double_word(n);
00267 }
00268
00269
00270
00271
00272
00273
00274
00275 INLINE void ConfigVariable::
00276 set_string_word(int n, const string &value) {
00277 nassertv(is_constructed());
00278 _core->make_local_value()->set_string_word(n, value);
00279 }
00280
00281
00282
00283
00284
00285
00286
00287 INLINE void ConfigVariable::
00288 set_bool_word(int n, bool value) {
00289 nassertv(is_constructed());
00290 _core->make_local_value()->set_bool_word(n, value);
00291 }
00292
00293
00294
00295
00296
00297
00298
00299 INLINE void ConfigVariable::
00300 set_int_word(int n, int value) {
00301 nassertv(is_constructed());
00302 _core->make_local_value()->set_int_word(n, value);
00303 }
00304
00305
00306
00307
00308
00309
00310
00311 INLINE void ConfigVariable::
00312 set_int64_word(int n, PN_int64 value) {
00313 nassertv(is_constructed());
00314 _core->make_local_value()->set_int_word(n, value);
00315 }
00316
00317
00318
00319
00320
00321
00322
00323 INLINE void ConfigVariable::
00324 set_double_word(int n, double value) {
00325 nassertv(is_constructed());
00326 _core->make_local_value()->set_double_word(n, value);
00327 }
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338 INLINE bool ConfigVariable::
00339 is_constructed() const {
00340 #ifndef NDEBUG
00341 if (_core == (ConfigVariableCore *)NULL) {
00342 report_unconstructed();
00343 return false;
00344 }
00345 #endif
00346 return true;
00347 }