14#ifndef CONFIGVARIABLEMANAGER_H
15#define CONFIGVARIABLEMANAGER_H
31class EXPCL_DTOOL_PRC ConfigVariableManager {
33 ConfigVariableManager();
34 ~ConfigVariableManager();
39 ConfigFlags::ValueType type,
40 const std::string &default_value,
41 const std::string &description = std::string(),
53 void output(std::ostream &out)
const;
54 void write(std::ostream &out)
const;
62 static ConfigVariableManager *get_global_ptr();
66 bool include_descriptions)
const;
70 typedef std::vector<ConfigVariableCore *> Variables;
73 typedef std::map<std::string, ConfigVariableCore *> VariablesByName;
74 VariablesByName _variables_by_name;
76 typedef std::map<GlobPattern, ConfigVariableCore *> VariableTemplates;
77 VariableTemplates _variable_templates;
79 static ConfigVariableManager *_global_ptr;
The internal definition of a ConfigVariable.
A global object that maintains the set of ConfigVariables (actually, ConfigVariableCores) everywhere ...
bool is_variable_used(size_t n) const
Returns true if the nth active ConfigVariable in the list has been used by code, false otherwise.
get_num_variables
Returns the current number of active ConfigVariableCores in the world.
void list_unused_variables() const
Writes a list of all the variables that have been defined in a prc file without having been declared ...
std::string get_variable_name(size_t n) const
Returns the name of the nth active ConfigVariable in the list.
ConfigVariableCore * make_variable_template(const std::string &pattern, ConfigFlags::ValueType type, const std::string &default_value, const std::string &description=std::string(), int flags=0)
Defines a variable "template" to match against dynamically-defined variables that may or may not be c...
void write_prc_variables(std::ostream &out) const
Writes all of the prc-set config variables, as they appear in a prc file somewhere,...
get_variable
Returns the nth active ConfigVariableCore in the world.
void list_variables() const
Writes a list of all the variables that have been declared somewhere in code, along with a brief desc...
void list_dynamic_variables() const
Writes a list of all the "dynamic" variables that have been declared somewhere in code,...
ConfigVariableCore * make_variable(const std::string &name)
Creates and returns a new, undefined ConfigVariableCore with the indicated name; or if a variable wit...
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.