Panda3D
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions
ConfigPageManager Class Reference

A global object that maintains the set of ConfigPages everywhere in the world, and keeps them in sorted order. More...

#include "configPageManager.h"

Inheritance diagram for ConfigPageManager:
ConfigFlags

List of all members.

Classes

class  ConfigFile

Public Member Functions

bool delete_explicit_page (ConfigPage *page)
 Removes a previously-constructed ConfigPage from the set of active pages, and deletes it.
ConfigPageget_explicit_page (int n) const
 Returns the nth explicit ConfigPage in the world.
ConfigPageget_implicit_page (int n) const
 Returns the nth implicit ConfigPage in the world.
int get_num_explicit_pages () const
 Returns the current number of explicitly-loaded ConfigPages in the world.
int get_num_implicit_pages () const
 Returns the current number of implicitly-loaded ConfigPages in the world.
int get_num_prc_encrypted_patterns () const
 Returns the number of patterns, like "*.pre", that are compiled in that will be searched for as special config files that are understood to be encrypted.
int get_num_prc_executable_patterns () const
 Returns the number of patterns, like "*.exe", that are compiled in that will be searched for as special config files that are to be executed as a program, and their output taken to be input.
int get_num_prc_patterns () const
 Returns the number of patterns, like "*.prc", that are compiled in that will be searched for as default config filenames.
string get_prc_encrypted_pattern (int n) const
 Returns the nth filename pattern that will be considered a match as a valid encrypted config file.
string get_prc_executable_pattern (int n) const
 Returns the nth filename pattern that will be considered a match as a valid executable-style config file.
string get_prc_pattern (int n) const
 Returns the nth filename pattern that will be considered a match as a valid config file.
DSearchPathget_search_path ()
 Returns the search path used to locate implicit .prc files.
void load_implicit_pages ()
 Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages.
bool loaded_implicit_pages () const
 Returns true if the implicit *.prc files have already been loaded, false otherwise.
ConfigPagemake_explicit_page (const string &name)
 Creates and returns a new, empty ConfigPage.
void mark_unsorted ()
 This method is meant to be used internally to this module; there is no need to call it directly.
void output (ostream &out) const
void reload_implicit_pages ()
 Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages.
void write (ostream &out) const

Static Public Member Functions

static ConfigPageManagerget_global_ptr ()

Protected Member Functions

 ConfigPageManager ()
 The constructor is private (actually, just protected, but only to avoid a gcc compiler warning) because it should not be explicitly constructed.
 ~ConfigPageManager ()
 The ConfigPageManager destructor should never be called, because this is a global object that is never freed.

Detailed Description

A global object that maintains the set of ConfigPages everywhere in the world, and keeps them in sorted order.

Definition at line 34 of file configPageManager.h.


Constructor & Destructor Documentation

The constructor is private (actually, just protected, but only to avoid a gcc compiler warning) because it should not be explicitly constructed.

There is only one ConfigPageManager, and it constructs itself.

Definition at line 52 of file configPageManager.cxx.

The ConfigPageManager destructor should never be called, because this is a global object that is never freed.

Definition at line 72 of file configPageManager.cxx.


Member Function Documentation

Removes a previously-constructed ConfigPage from the set of active pages, and deletes it.

The ConfigPage object is no longer valid after this call. Returns true if the page is successfully deleted, or false if it was unknown (which should never happen if the page was legitimately constructed).

Definition at line 449 of file configPageManager.cxx.

References ConfigFlags::invalidate_cache().

ConfigPage * ConfigPageManager::get_explicit_page ( int  n) const [inline]

Returns the nth explicit ConfigPage in the world.

See get_num_explicit_pages().

Definition at line 185 of file configPageManager.I.

ConfigPage * ConfigPageManager::get_implicit_page ( int  n) const [inline]

Returns the nth implicit ConfigPage in the world.

See get_num_implicit_pages().

Definition at line 159 of file configPageManager.I.

Returns the current number of explicitly-loaded ConfigPages in the world.

These represent pages that were loaded dynamically at runtime by explicit calls to ConfigPageManager::make_explicit_page().

Definition at line 174 of file configPageManager.I.

Returns the current number of implicitly-loaded ConfigPages in the world.

These represent files that were automatically discovered on the disk as .prc files.

Definition at line 148 of file configPageManager.I.

Returns the number of patterns, like "*.pre", that are compiled in that will be searched for as special config files that are understood to be encrypted.

Definition at line 95 of file configPageManager.I.

Returns the number of patterns, like "*.exe", that are compiled in that will be searched for as special config files that are to be executed as a program, and their output taken to be input.

This is normally empty.

Definition at line 122 of file configPageManager.I.

Returns the number of patterns, like "*.prc", that are compiled in that will be searched for as default config filenames.

Normally there is only one pattern, and it is "*.prc", but others may be specified with the PRC_FILENAME variable in Config.pp.

Definition at line 70 of file configPageManager.I.

string ConfigPageManager::get_prc_encrypted_pattern ( int  n) const [inline]

Returns the nth filename pattern that will be considered a match as a valid encrypted config file.

See get_num_prc_encrypted_patterns().

Definition at line 107 of file configPageManager.I.

string ConfigPageManager::get_prc_executable_pattern ( int  n) const [inline]

Returns the nth filename pattern that will be considered a match as a valid executable-style config file.

See get_num_prc_executable_patterns().

Definition at line 134 of file configPageManager.I.

string ConfigPageManager::get_prc_pattern ( int  n) const [inline]

Returns the nth filename pattern that will be considered a match as a valid config file.

See get_num_prc_patterns().

Definition at line 82 of file configPageManager.I.

Returns the search path used to locate implicit .prc files.

This is determined by the PRC_DIR and PRC_PATH environment variables. The object returned by this method may be modified to change the path at runtime, and then reload_implicit_pages() called.

Definition at line 54 of file configPageManager.I.

References load_implicit_pages().

Searches the PRC_DIR and/or PRC_PATH directories for .prc files and loads them in as pages.

This is normally called automatically at startup time, when the first variable's value is referenced. See also reload_implicit_pages().

Definition at line 38 of file configPageManager.I.

References reload_implicit_pages().

Referenced by get_search_path().

Returns true if the implicit *.prc files have already been loaded, false otherwise.

Normally this will only be false briefly before startup.

Definition at line 24 of file configPageManager.I.

Creates and returns a new, empty ConfigPage.

This page will be stacked on top of any pages that were created before; it may shadow variable declarations that are defined in previous pages.

Definition at line 429 of file configPageManager.cxx.

References ConfigFlags::invalidate_cache().

This method is meant to be used internally to this module; there is no need to call it directly.

It indicates that the sort values of some pages may have changed and pages need to be re-sorted.

Definition at line 201 of file configPageManager.I.

Referenced by ConfigPage::set_sort().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations