Panda3D
|
This is a nested reference to an instance of a template object, declared via the syntax: More...
#include "xFileDataNodeReference.h"
Public Member Functions | |
XFileDataNodeReference (XFileDataNodeTemplate *object) | |
virtual TypeHandle | force_init_type () |
XFileDataNodeTemplate * | get_object () const |
Returns the actual data object being referenced. | |
XFileTemplate * | get_template () const |
Returns the template used to define this data object. | |
virtual TypeHandle | get_type () const |
virtual bool | is_complex_object () const |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise. | |
virtual bool | is_reference () const |
Returns true if this node represents an indirect reference to an object defined previously in the file. | |
virtual void | write_text (ostream &out, int indent_level) const |
Writes a suitable representation of this node to an .x file in text mode. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual XFileDataObject * | get_element (int n) |
Returns the nth nested data element within the object. | |
virtual XFileDataObject * | get_element (const string &name) |
Returns the nested data element within the object that has the indicated name. | |
virtual int | get_num_elements () const |
Returns the number of nested data elements within the object. |
This is a nested reference to an instance of a template object, declared via the syntax:
{ InstanceName }
in the X File.
Definition at line 31 of file xFileDataNodeReference.h.
XFileDataObject * XFileDataNodeReference::get_element | ( | int | n | ) | [protected, virtual] |
Returns the nth nested data element within the object.
Reimplemented from XFileDataObject.
Definition at line 104 of file xFileDataNodeReference.cxx.
XFileDataObject * XFileDataNodeReference::get_element | ( | const string & | name | ) | [protected, virtual] |
Returns the nested data element within the object that has the indicated name.
Reimplemented from XFileDataObject.
Definition at line 115 of file xFileDataNodeReference.cxx.
int XFileDataNodeReference::get_num_elements | ( | ) | const [protected, virtual] |
Returns the number of nested data elements within the object.
This may be, e.g. the size of the array, if it is an array.
Reimplemented from XFileDataObject.
Definition at line 93 of file xFileDataNodeReference.cxx.
XFileDataNodeTemplate * XFileDataNodeReference::get_object | ( | ) | const [inline] |
Returns the actual data object being referenced.
Definition at line 22 of file xFileDataNodeReference.I.
XFileTemplate* XFileDataNodeReference::get_template | ( | ) | const [inline] |
Returns the template used to define this data object.
Since the only classes to inherit from XFileDataNode are XFileDataNodeTemplate and XFileDataNodeReference, both of which represent a class that is defined by a template, it makes sense to put this common method here in the base class.
Reimplemented from XFileDataNode.
bool XFileDataNodeReference::is_complex_object | ( | ) | const [virtual] |
Returns true if this kind of data object is a complex object that can hold nested data elements, false otherwise.
Reimplemented from XFileDataObject.
Definition at line 69 of file xFileDataNodeReference.cxx.
bool XFileDataNodeReference::is_reference | ( | ) | const [virtual] |
Returns true if this node represents an indirect reference to an object defined previously in the file.
References are generally transparent, so in most cases you never need to call this, unless you actually need to differentiate between references and instances; you can simply use the reference node as if it were itself the object it references.
If this returns true, the node must be of type XFileDataNodeReference.
Reimplemented from XFileNode.
Definition at line 57 of file xFileDataNodeReference.cxx.
void XFileDataNodeReference::write_text | ( | ostream & | out, |
int | indent_level | ||
) | const [virtual] |
Writes a suitable representation of this node to an .x file in text mode.
Reimplemented from XFileNode.
Definition at line 80 of file xFileDataNodeReference.cxx.