ConfigVariableCore

from panda3d.core import ConfigVariableCore
class ConfigVariableCore

Bases: ConfigFlags

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.

Inheritance diagram

Inheritance diagram of ConfigVariableCore

__init__(*args, **kwargs)
clearLocalValue()

C++ Interface: clear_local_value(const ConfigVariableCore self)

/**
  • Removes the local value defined for this variable, and allows its value to

  • be once again retrieved from the .prc files.

  • Returns true if the value was successfully removed, false if it did not

  • exist in the first place.

*/

clear_local_value()

C++ Interface: clear_local_value(const ConfigVariableCore self)

/**
  • Removes the local value defined for this variable, and allows its value to

  • be once again retrieved from the .prc files.

  • Returns true if the value was successfully removed, false if it did not

  • exist in the first place.

*/

closed
declarations
default_value
description
dynamic
getDeclaration()

C++ Interface: get_declaration(ConfigVariableCore self, int n)

/**
  • Returns the nth declarations that contributes to this variable’s value.

  • The declarations are arranged in order such that earlier declarations

  • shadow later declarations; thus, get_declaration(0) is always defined and

  • always returns the current value of the variable.

*/

getDeclarations()
getDefaultValue()

C++ Interface: get_default_value(ConfigVariableCore self)

/**
  • Returns the default variable specified for this variable. If the variable

  • has not yet been defined, this will return NULL.

*/

getDescription()

C++ Interface: get_description(ConfigVariableCore self)

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

*/

getFlags()

C++ Interface: get_flags(ConfigVariableCore self)

/**
  • 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.

*/

getName()

C++ Interface: get_name(ConfigVariableCore self)

/**
  • Returns the name of the variable.

*/

getNumDeclarations()

C++ Interface: get_num_declarations(ConfigVariableCore self)

/**
  • Returns the number of declarations that contribute to this variable’s

  • value. If the variable has been defined, this will always be at least 1

  • (for the default value, at least).

*/

getNumReferences()

C++ Interface: get_num_references(ConfigVariableCore self)

/**
  • Returns the number of prc files that reference this variable. This is not

  • exactly the same as the number of declarations; see get_reference().

*/

getNumTrustedReferences()

C++ Interface: get_num_trusted_references(ConfigVariableCore self)

/**
  • Returns the number of trusted prc files that reference this variable. See

  • also get_num_references().

*/

getNumUniqueReferences()

C++ Interface: get_num_unique_references(ConfigVariableCore self)

/**
  • Returns the number of trusted, unique (by string value) values there exist

  • for this variable.

*/

getReference()

C++ Interface: get_reference(ConfigVariableCore self, 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.

*/

getReferences()
getTrustLevel()

C++ Interface: get_trust_level(ConfigVariableCore self)

/**
  • 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).

*/

getTrustedReference()

C++ Interface: get_trusted_reference(ConfigVariableCore self, 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.

*/

getTrustedReferences()
getUniqueReference()

C++ Interface: get_unique_reference(ConfigVariableCore self, int n)

/**
  • Returns the nth trusted, unique value for this variable. This is similar

  • to get_trusted_reference(), except that duplicate values are removed.

*/

getUniqueReferences()
getValueType()

C++ Interface: get_value_type(ConfigVariableCore self)

/**
  • Returns the stated type of this variable. If the variable has not yet been

  • defined, this will be VT_undefined.

*/

get_declaration()

C++ Interface: get_declaration(ConfigVariableCore self, int n)

/**
  • Returns the nth declarations that contributes to this variable’s value.

  • The declarations are arranged in order such that earlier declarations

  • shadow later declarations; thus, get_declaration(0) is always defined and

  • always returns the current value of the variable.

*/

get_declarations()
get_default_value()

C++ Interface: get_default_value(ConfigVariableCore self)

/**
  • Returns the default variable specified for this variable. If the variable

  • has not yet been defined, this will return NULL.

*/

get_description()

C++ Interface: get_description(ConfigVariableCore self)

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

*/

get_flags()

C++ Interface: get_flags(ConfigVariableCore self)

/**
  • 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.

*/

get_name()

C++ Interface: get_name(ConfigVariableCore self)

/**
  • Returns the name of the variable.

*/

get_num_declarations()

C++ Interface: get_num_declarations(ConfigVariableCore self)

/**
  • Returns the number of declarations that contribute to this variable’s

  • value. If the variable has been defined, this will always be at least 1

  • (for the default value, at least).

*/

get_num_references()

C++ Interface: get_num_references(ConfigVariableCore self)

/**
  • Returns the number of prc files that reference this variable. This is not

  • exactly the same as the number of declarations; see get_reference().

*/

get_num_trusted_references()

C++ Interface: get_num_trusted_references(ConfigVariableCore self)

/**
  • Returns the number of trusted prc files that reference this variable. See

  • also get_num_references().

*/

get_num_unique_references()

C++ Interface: get_num_unique_references(ConfigVariableCore self)

/**
  • Returns the number of trusted, unique (by string value) values there exist

  • for this variable.

*/

get_reference()

C++ Interface: get_reference(ConfigVariableCore self, 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.

*/

get_references()
get_trust_level()

C++ Interface: get_trust_level(ConfigVariableCore self)

/**
  • 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).

*/

get_trusted_reference()

C++ Interface: get_trusted_reference(ConfigVariableCore self, 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.

*/

get_trusted_references()
get_unique_reference()

C++ Interface: get_unique_reference(ConfigVariableCore self, int n)

/**
  • Returns the nth trusted, unique value for this variable. This is similar

  • to get_trusted_reference(), except that duplicate values are removed.

*/

get_unique_references()
get_value_type()

C++ Interface: get_value_type(ConfigVariableCore self)

/**
  • Returns the stated type of this variable. If the variable has not yet been

  • defined, this will be VT_undefined.

*/

hasLocalValue()

C++ Interface: has_local_value(ConfigVariableCore self)

/**
  • Returns true if this variable’s value has been shadowed by a local

  • assignment (as created via make_local_value()), or false otherwise.

*/

hasValue()

C++ Interface: has_value(ConfigVariableCore self)

/**
  • 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.

*/

has_local_value()

C++ Interface: has_local_value(ConfigVariableCore self)

/**
  • Returns true if this variable’s value has been shadowed by a local

  • assignment (as created via make_local_value()), or false otherwise.

*/

has_value()

C++ Interface: has_value(ConfigVariableCore self)

/**
  • 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.

*/

isClosed()

C++ Interface: is_closed(ConfigVariableCore self)

/**
  • 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).

*/

isDynamic()

C++ Interface: is_dynamic(ConfigVariableCore self)

/**
  • 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.

*/

isUsed()

C++ Interface: is_used(ConfigVariableCore self)

/**
  • Returns true if the variable has been referenced by a ConfigVariable

  • somewhere in code, false otherwise.

*/

is_closed()

C++ Interface: is_closed(ConfigVariableCore self)

/**
  • 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).

*/

is_dynamic()

C++ Interface: is_dynamic(ConfigVariableCore self)

/**
  • 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.

*/

is_used()

C++ Interface: is_used(ConfigVariableCore self)

/**
  • Returns true if the variable has been referenced by a ConfigVariable

  • somewhere in code, false otherwise.

*/

makeLocalValue()

C++ Interface: make_local_value(const ConfigVariableCore self)

/**
  • Creates a new local value for this variable, if there is not already one

  • specified. This will shadow any values defined in the various .prc files.

  • If there is already a local value defined for this variable, simply returns

  • that one.

  • Use clear_local_value() to remove the local value definition.

*/

make_local_value()

C++ Interface: make_local_value(const ConfigVariableCore self)

/**
  • Creates a new local value for this variable, if there is not already one

  • specified. This will shadow any values defined in the various .prc files.

  • If there is already a local value defined for this variable, simply returns

  • that one.

  • Use clear_local_value() to remove the local value definition.

*/

name
output()

C++ Interface: output(ConfigVariableCore self, ostream out)

/**

*/

references
setDefaultValue()

C++ Interface: set_default_value(const ConfigVariableCore self, str default_value)

/**
  • Specifies the default value for this variable if it is not defined in any

  • prc file.

*/

setDescription()

C++ Interface: set_description(const ConfigVariableCore self, str description)

/**
  • Specifies the one-line description of this variable. See

  • get_description(). It is not an error to call this multiple times, but if

  • the value changes once get_declaration() has been called, a warning is

  • printed.

*/

setFlags()

C++ Interface: set_flags(const ConfigVariableCore self, int flags)

/**
  • Specifies the trust level of this variable. See get_flags(). It is not an

  • error to call this multiple times, but if the value changes once

  • get_declaration() has been called, a warning is printed.

*/

setUsed()

C++ Interface: set_used(const ConfigVariableCore self)

/**
  • Marks that the variable has been “declared” by a ConfigVariable.

*/

setValueType()

C++ Interface: set_value_type(const ConfigVariableCore self, int value_type)

/**
  • Specifies the type of this variable. See get_value_type(). It is not an

  • error to call this multiple times, but if the value changes once

  • get_declaration() has been called, a warning is printed.

*/

set_default_value()

C++ Interface: set_default_value(const ConfigVariableCore self, str default_value)

/**
  • Specifies the default value for this variable if it is not defined in any

  • prc file.

*/

set_description()

C++ Interface: set_description(const ConfigVariableCore self, str description)

/**
  • Specifies the one-line description of this variable. See

  • get_description(). It is not an error to call this multiple times, but if

  • the value changes once get_declaration() has been called, a warning is

  • printed.

*/

set_flags()

C++ Interface: set_flags(const ConfigVariableCore self, int flags)

/**
  • Specifies the trust level of this variable. See get_flags(). It is not an

  • error to call this multiple times, but if the value changes once

  • get_declaration() has been called, a warning is printed.

*/

set_used()

C++ Interface: set_used(const ConfigVariableCore self)

/**
  • Marks that the variable has been “declared” by a ConfigVariable.

*/

set_value_type()

C++ Interface: set_value_type(const ConfigVariableCore self, int value_type)

/**
  • Specifies the type of this variable. See get_value_type(). It is not an

  • error to call this multiple times, but if the value changes once

  • get_declaration() has been called, a warning is printed.

*/

trust_level
trusted_references
unique_references
upcastToConfigFlags()

C++ Interface: upcast_to_ConfigFlags(const ConfigVariableCore self)

upcast from ConfigVariableCore to ConfigFlags

upcast_to_ConfigFlags()

C++ Interface: upcast_to_ConfigFlags(const ConfigVariableCore self)

upcast from ConfigVariableCore to ConfigFlags

used
value_type
write()

C++ Interface: write(ConfigVariableCore self, ostream out)

/**

*/