|
|
|
This class is the base class for both ConfigVariableList and ConfigVariable (and hence for all of the ConfigVariableBool, ConfigVaribleString, etc.
More...
#include "configVariableBase.h"
List of all members.
Public Member Functions |
| bool | clear_local_value () |
| | Removes the local value defined for this variable, and allows its value to be once again retrieved from the .prc files.
|
| const string & | get_description () const |
| | Returns the brief description of this variable, if it has been defined.
|
| int | get_flags () const |
| | Returns the flags value as set by set_flags().
|
| const string & | get_name () const |
| | Returns the name of the variable.
|
| int | get_trust_level () const |
| | Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.
|
| ValueType | get_value_type () const |
| | Returns the stated type of 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_local_value()), or false otherwise.
|
| bool | has_value () const |
| | Returns true if this variable has an explicit value, either from a prc file or locally set, or false if variable has its default value.
|
| bool | is_closed () const |
| | Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its compiled-in default value), or false for the normal case, in which the variable can be modified by any prc file at or above its trust level (see get_trust_level()).
|
| bool | is_dynamic () const |
| | Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name was dynamically generated, possibly from a large pool, and it should not be listed along with the other variables.
|
|
void | output (ostream &out) const |
|
void | write (ostream &out) const |
Protected Types |
typedef pset< const
ConfigVariableBase * > | Unconstructed |
Protected Member Functions |
| | ConfigVariableBase (const string &name, ValueType type) |
| | This constructor is only intended to be called from a specialized ConfigVariableFoo derived class.
|
| | ConfigVariableBase (const string &name, ValueType type, const string &description, int flags) |
| | This constructor is only intended to be called from a specialized ConfigVariableFoo derived class.
|
| void | record_unconstructed () const |
| | Records that this config variable was referenced before it was constructed (presumably a static-init ordering issue).
|
| bool | was_unconstructed () const |
| | Returns true if record_unconstructed() was ever called on this pointer, false otherwise.
|
Protected Attributes |
|
ConfigVariableCore * | _core |
Static Protected Attributes |
|
static Unconstructed * | _unconstructed |
Detailed Description
This class is the base class for both ConfigVariableList and ConfigVariable (and hence for all of the ConfigVariableBool, ConfigVaribleString, etc.
classes). It collects together the common interface for all generic ConfigVariables.
Mostly, this class serves as a thin wrapper around ConfigVariableCore and/or ConfigDeclaration, more or less duplicating the interface presented there.
Definition at line 48 of file configVariableBase.h.
Constructor & Destructor Documentation
| ConfigVariableBase::ConfigVariableBase |
( |
const string & |
name, |
|
|
ConfigVariableBase::ValueType |
value_type |
|
) |
| [inline, protected] |
| ConfigVariableBase::ConfigVariableBase |
( |
const string & |
name, |
|
|
ConfigVariableBase::ValueType |
value_type, |
|
|
const string & |
description, |
|
|
int |
flags |
|
) |
| [protected] |
Member Function Documentation
| bool ConfigVariableBase::clear_local_value |
( |
| ) |
[inline] |
| const string & ConfigVariableBase::get_description |
( |
| ) |
const [inline] |
| int ConfigVariableBase::get_flags |
( |
| ) |
const [inline] |
| const string & ConfigVariableBase::get_name |
( |
| ) |
const [inline] |
| int ConfigVariableBase::get_trust_level |
( |
| ) |
const [inline] |
Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.
Arguably, this should be called the "mistrust level", since the larger the value, the more suspicious we are of prc files. This value is not used if is_closed() returns true, which indicates no file may be trusted.
This value only has effect in a release build (specifically, when PRC_RESPECT_TRUST_LEVEL is defined true in Config.pp).
Definition at line 128 of file configVariableBase.I.
References ConfigVariableCore::get_trust_level().
| ConfigVariableBase::ValueType ConfigVariableBase::get_value_type |
( |
| ) |
const [inline] |
| bool ConfigVariableBase::has_local_value |
( |
| ) |
const [inline] |
| bool ConfigVariableBase::has_value |
( |
| ) |
const [inline] |
| bool ConfigVariableBase::is_closed |
( |
| ) |
const [inline] |
Returns true if the variable is not trusted by any prc file (and hence cannot be modified from its compiled-in default value), or false for the normal case, in which the variable can be modified by any prc file at or above its trust level (see get_trust_level()).
This value only has effect in a release build (specifically, when PRC_RESPECT_TRUST_LEVEL is defined true in Config.pp).
Definition at line 107 of file configVariableBase.I.
References ConfigVariableCore::is_closed().
| bool ConfigVariableBase::is_dynamic |
( |
| ) |
const [inline] |
Returns true if the variable was indicated as "dynamic" by its constructor, indicating that its name was dynamically generated, possibly from a large pool, and it should not be listed along with the other variables.
Definition at line 143 of file configVariableBase.I.
References ConfigVariableCore::is_dynamic().
| void ConfigVariableBase::record_unconstructed |
( |
| ) |
const [protected] |
Records that this config variable was referenced before it was constructed (presumably a static-init ordering issue).
This is used to print a useful error message later, when the constructor is actually called (and we then know what the name of the variable is).
Definition at line 62 of file configVariableBase.cxx.
Referenced by ConfigVariable::report_unconstructed().
| bool ConfigVariableBase::was_unconstructed |
( |
| ) |
const [protected] |
The documentation for this class was generated from the following files:
| | |