Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# ConfigVariableCore Class Reference

The internal definition of a ConfigVariable. More...

Inheritance diagram for ConfigVariableCore:

List of all members.

## Public Member Functions
bool | clearLocalValue ()
ConfigDeclaration const | getDeclaration (int n)
ConfigDeclaration const | getDefaultValue ()
| Returns the default variable specified for this variable.
string | getDescription ()
| Returns the brief description of this variable, if it has been defined.
int | getFlags ()
| Returns the flags value as set by set_flags().
string | getName ()
| Returns the name of the variable.
int | getNumDeclarations ()
int | getNumReferences ()
| Returns the number of prc files that reference this variable.
int | getNumTrustedReferences ()
| Returns the number of trusted prc files that reference this variable.
int | getNumUniqueReferences ()
| Returns the number of trusted, unique (by string value) values there exist for this variable.
ConfigDeclaration const | getReference (int n)
| Returns the nth declaration in a prc file that references this variable.
ConfigDeclaration const | getTrustedReference (int n)
| Returns the nth declaration in a trusted prc file that references this variable.
int | getTrustLevel ()
| Returns the minimum trust_level a prc file must demonstrate in order to redefine the value for this variable.
ConfigDeclaration const | getUniqueReference (int n)
| Returns the nth trusted, unique value for this variable.
ValueType | getValueType ()
| Returns the stated type of this variable.
bool | hasLocalValue ()
| Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise.
bool | hasValue ()
bool | isClosed ()
| 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 | isDynamic ()
| 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.
bool | isUsed ()
| Returns true if the variable has been referenced by a ConfigVariable somewhere in code, false otherwise.
ConfigDeclaration | makeLocalValue ()
| output (ostream out)
| setDefaultValue (string default_value)
| setDescription (string description)
| setFlags (int flags)
| setUsed ()
| Marks that the variable has been "declared" by a ConfigVariable.
| setValueType (ValueType value_type)
| write (ostream out)

## Detailed Description

The internal definition of a ConfigVariable.

This object is shared between all instances of a ConfigVariable that use the same variable name.

You cannot create a ConfigVariableCore instance directly; instead, use the make() method, which may return a shared instance. Once created, these objects are never destructed.

## Member Function Documentation

bool clearLocalValue | ( |  | ) |

ConfigDeclaration const getDeclaration | ( | int | n | ) |

ConfigDeclaration const getDefaultValue | ( |  | ) |

Returns the default variable specified for this variable.

If the variable has not yet been defined, this will return NULL.

string getDescription | ( |  | ) |

Returns the brief description of this variable, if it has been defined.

int getFlags | ( |  | ) |

Returns the flags value as set by set_flags().

This includes the trust level and some other settings. See the individual methods is_closed(), get_trust_level(), etc. to pull out the semantic meaning of these flags individually.

string getName | ( |  | ) |

Returns the name of the variable.

int getNumDeclarations | ( |  | ) |

int getNumReferences | ( |  | ) |

Returns the number of prc files that reference this variable.

This is not exactly the same as the number of declarations; see get_reference().

int getNumTrustedReferences | ( |  | ) |

Returns the number of trusted prc files that reference this variable.

See also get_num_references().

int getNumUniqueReferences | ( |  | ) |

Returns the number of trusted, unique (by string value) values there exist for this variable.

ConfigDeclaration const getReference | ( | int | n | ) |

Returns the nth declaration in a prc file that references this variable.

This is similar, but not identical to, get_declaration(). The difference is that this will list *only* true references in a prc file, and will not list default values or locally-assigned values; it also will list even the untrusted files.

ConfigDeclaration const getTrustedReference | ( | int | n | ) |

Returns the nth declaration in a trusted prc file that references this variable.

This is similar, but not identical to, get_declaration(). The difference is that this will list *only* true references in a prc file, and will not list default values or locally-assigned values.

This is also similar to get_reference(), except that it only lists the trusted declarations, omitting the untrusted ones.

int getTrustLevel | ( |  | ) |

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).

ConfigDeclaration const getUniqueReference | ( | int | n | ) |

Returns the nth trusted, unique value for this variable.

This is similar to get_trusted_reference(), except that duplicate values are removed.

ValueType getValueType | ( |  | ) |

Returns the stated type of this variable.

If the variable has not yet been defined, this will be VT_undefined.

bool hasLocalValue | ( |  | ) |

Returns true if this variable's value has been shadowed by a local assignment (as created via make_local_value()), or false otherwise.

bool hasValue | ( |  | ) |

bool isClosed | ( |  | ) |

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).

bool isDynamic | ( |  | ) |

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.

bool isUsed | ( |  | ) |

Returns true if the variable has been referenced by a ConfigVariable somewhere in code, false otherwise.

ConfigDeclaration makeLocalValue | ( |  | ) |

output | ( | ostream | out | ) |

setDefaultValue | ( | string | default_value | ) |

setDescription | ( | string | description | ) |

setFlags | ( | int | flags | ) |

setUsed | ( |  | ) |

Marks that the variable has been "declared" by a ConfigVariable.

setValueType | ( | ValueType | value_type | ) |

write | ( | ostream | out | ) |

All Classes Namespaces Functions Variables Enumerations Enumerator Properties