14#ifndef CONFIGVARIABLECORE_H
15#define CONFIGVARIABLECORE_H
34class EXPCL_DTOOL_PRC ConfigVariableCore :
public ConfigFlags {
36 ConfigVariableCore(
const std::string &name);
37 ConfigVariableCore(
const ConfigVariableCore &templ,
const std::string &name);
38 ~ConfigVariableCore();
41 INLINE
const std::string &
get_name()
const;
68 INLINE
const ConfigDeclaration *
get_reference(
size_t n)
const;
80 void output(std::ostream &out)
const;
81 void write(std::ostream &out)
const;
98 void add_declaration(ConfigDeclaration *decl);
99 void remove_declaration(ConfigDeclaration *decl);
101 INLINE
void check_sort_declarations()
const;
102 void sort_declarations();
107 ValueType _value_type;
108 std::string _description;
110 ConfigDeclaration *_default_value;
111 ConfigDeclaration *_local_value;
113 typedef std::vector<const ConfigDeclaration *> Declarations;
114 Declarations _declarations;
115 Declarations _trusted_declarations;
116 Declarations _untrusted_declarations;
117 Declarations _unique_declarations;
118 bool _declarations_sorted;
121 friend class ConfigDeclaration;
122 friend class ConfigVariableManager;
125INLINE std::ostream &operator << (std::ostream &out,
const ConfigVariableCore &variable);
A single declaration of a config variable, typically defined as one line in a .prc file,...
This class is the base class of both ConfigVariable and ConfigVariableCore.
The internal definition of a ConfigVariable.
void set_flags(int flags)
Specifies the trust level of this variable.
get_trusted_reference
Returns the nth declaration in a trusted prc file that references this variable.
bool has_local_value() const
Returns true if this variable's value has been shadowed by a local assignment (as created via make_lo...
get_num_trusted_references
Returns the number of trusted prc files that reference this variable.
get_declaration
Returns the nth declarations that contributes to this variable's value.
get_unique_reference
Returns the nth trusted, unique value for this variable.
get_value_type
Returns the stated type of this variable.
set_default_value
Specifies the default value for this variable if it is not defined in any prc file.
get_default_value
Returns the default variable specified for this variable.
get_reference
Returns the nth declaration in a prc file that references this variable.
bool has_value() const
Returns true if this variable has an explicit value, either from a prc file or locally set,...
is_dynamic
Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name ...
void set_used()
Marks that the variable has been "declared" by a ConfigVariable.
set_description
Specifies the one-line description of this variable.
bool clear_local_value()
Removes the local value defined for this variable, and allows its value to be once again retrieved fr...
int get_flags() const
Returns the flags value as set by set_flags().
is_closed
Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its co...
get_num_references
Returns the number of prc files that reference this variable.
get_description
Returns the brief description of this variable, if it has been defined.
get_num_declarations
Returns the number of declarations that contribute to this variable's value.
get_name
Returns the name of the variable.
ConfigDeclaration * make_local_value()
Creates a new local value for this variable, if there is not already one specified.
get_trust_level
Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this v...
get_num_unique_references
Returns the number of trusted, unique (by string value) values there exist for this variable.
set_value_type
Specifies the type of this variable.
is_used
Returns true if the variable has been referenced by a ConfigVariable somewhere in code,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.