Panda3D
Public Member Functions

DCFile Class Reference

Represents the complete list of Distributed Class descriptions as read from a .dc file. More...

List of all members.

Public Member Functions

 DCFile ()
bool allObjectsValid ()
 Returns true if all of the classes read from the DC file were defined and valid, or false if any of them were undefined ("bogus classes").
 clear ()
 Removes all of the classes defined within the DCFile and prepares it for reading a new file.
DCClass getClass (int n)
 Returns the nth class read from the .dc file(s).
DCClass getClassByName (string name)
 Returns the class that has the indicated name, or NULL if there is no such class.
DCField getFieldByIndex (int index_number)
 Returns a pointer to the one DCField that has the indicated index number, of all the DCFields across all classes in the file.
unsigned long int getHash ()
 Returns a 32-bit hash index associated with this file.
string getImportModule (int n)
 Returns the module named by the nth import line read from the .dc file(s).
string getImportSymbol (int n, int i)
 Returns the ith symbol named by the nth import line read from the .dc file(s).
DCKeyword const getKeyword (int n)
 Returns the nth keyword read from the .dc file(s).
DCKeyword const getKeywordByName (string name)
 Returns the keyword that has the indicated name, or NULL if there is no such keyword name.
int getNumClasses ()
 Returns the number of classes read from the .dc file(s).
int getNumImportModules ()
 Returns the number of import lines read from the .dc file(s).
int getNumImportSymbols (int n)
 Returns the number of symbols explicitly imported by the nth import line.
int getNumKeywords ()
 Returns the number of keywords read from the .dc file(s).
int getNumTypedefs ()
 Returns the number of typedefs read from the .dc file(s).
DCSwitch getSwitchByName (string name)
 Returns the switch that has the indicated name, or NULL if there is no such switch.
DCTypedef getTypedef (int n)
 Returns the nth typedef read from the .dc file(s).
DCTypedef getTypedefByName (string name)
 Returns the typedef that has the indicated name, or NULL if there is no such typedef name.
bool read (istream in, string filename)
 Parses the already-opened input stream for distributed class descriptions.
bool read (Filename filename)
 Opens and reads the indicated .dc file by name.
bool read (istream in)
 Parses the already-opened input stream for distributed class descriptions.
bool readAll ()
 This special method reads all of the .dc files named by the "dc-file" config.prc variable, and loads them into the DCFile namespace.
bool write (Filename filename, bool brief)
 Opens the indicated filename for output and writes a parseable description of all the known distributed classes to the file.
bool write (ostream out, bool brief)
 Writes a parseable description of all the known distributed classes to the stream.

Detailed Description

Represents the complete list of Distributed Class descriptions as read from a .dc file.


Constructor & Destructor Documentation

DCFile ( )

Member Function Documentation

bool allObjectsValid ( )

Returns true if all of the classes read from the DC file were defined and valid, or false if any of them were undefined ("bogus classes").

If this is true, we might have read a partial file.

clear ( )

Removes all of the classes defined within the DCFile and prepares it for reading a new file.

DCClass getClass ( int  n)

Returns the nth class read from the .dc file(s).

DCClass getClassByName ( string  name)

Returns the class that has the indicated name, or NULL if there is no such class.

DCField getFieldByIndex ( int  index_number)

Returns a pointer to the one DCField that has the indicated index number, of all the DCFields across all classes in the file.

This method is only valid if dc-multiple-inheritance is set true in the Config.prc file. Without this setting, different DCFields may share the same index number, so this global lookup is not possible.

unsigned long int getHash ( )

Returns a 32-bit hash index associated with this file.

This number is guaranteed to be consistent if the contents of the file have not changed, and it is very likely to be different if the contents of the file do change.

string getImportModule ( int  n)

Returns the module named by the nth import line read from the .dc file(s).

string getImportSymbol ( int  n,
int  i 
)

Returns the ith symbol named by the nth import line read from the .dc file(s).

DCKeyword const getKeyword ( int  n)

Returns the nth keyword read from the .dc file(s).

DCKeyword const getKeywordByName ( string  name)

Returns the keyword that has the indicated name, or NULL if there is no such keyword name.

int getNumClasses ( )

Returns the number of classes read from the .dc file(s).

int getNumImportModules ( )

Returns the number of import lines read from the .dc file(s).

int getNumImportSymbols ( int  n)

Returns the number of symbols explicitly imported by the nth import line.

If this is 0, the line is "import modulename"; if it is more than 0, the line is "from modulename import symbol, symbol ... ".

int getNumKeywords ( )

Returns the number of keywords read from the .dc file(s).

int getNumTypedefs ( )

Returns the number of typedefs read from the .dc file(s).

DCSwitch getSwitchByName ( string  name)

Returns the switch that has the indicated name, or NULL if there is no such switch.

DCTypedef getTypedef ( int  n)

Returns the nth typedef read from the .dc file(s).

DCTypedef getTypedefByName ( string  name)

Returns the typedef that has the indicated name, or NULL if there is no such typedef name.

bool read ( Filename  filename)

Opens and reads the indicated .dc file by name.

The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.

Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).

bool read ( istream  in)

Parses the already-opened input stream for distributed class descriptions.

The filename parameter is optional and is only used when reporting errors.

The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.

Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).

bool read ( istream  in,
string  filename 
)

Parses the already-opened input stream for distributed class descriptions.

The filename parameter is optional and is only used when reporting errors.

The distributed classes defined in the file will be appended to the set of distributed classes already recorded, if any.

Returns true if the file is successfully read, false if there was an error (in which case the file might have been partially read).

bool readAll ( )

This special method reads all of the .dc files named by the "dc-file" config.prc variable, and loads them into the DCFile namespace.

bool write ( ostream  out,
bool  brief 
)

Writes a parseable description of all the known distributed classes to the stream.

Returns true if the description is successfully written, false otherwise.

bool write ( Filename  filename,
bool  brief 
)

Opens the indicated filename for output and writes a parseable description of all the known distributed classes to the file.

Returns true if the description is successfully written, false otherwise.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties