|
|
|
A definition of a single data element appearing within a template record.
More...
#include "xFileDataDef.h"
List of all members.
Public Types |
| enum | Type {
T_word,
T_dword,
T_float,
T_double,
T_char,
T_uchar,
T_sword,
T_sdword,
T_string,
T_cstring,
T_unicode,
T_template
} |
Public Member Functions |
|
| XFileDataDef (XFile *x_file, const string &name, Type type, XFileTemplate *xtemplate=NULL) |
| void | add_array_def (const XFileArrayDef &array_def) |
| | Adds an additional array dimension to the data description.
|
| virtual void | clear () |
| | Removes all children from the node, and otherwise resets it to its initial state.
|
| virtual bool | fill_zero_data (XFileDataObject *object) const |
| | This is similar to repack_data(), except it is used to fill the initial values for a newly-created template object to zero.
|
|
virtual TypeHandle | force_init_type () |
| const XFileArrayDef & | get_array_def (int i) const |
| | Returns the description of the nth dimension of array elements on this data object.
|
| Type | get_data_type () const |
| | Returns the primitive type of this element, or T_template if this represents a nested template object.
|
| int | get_num_array_defs () const |
| | Returns the number of dimensions of array elements on this data object, or 0 if the data object is not an array.
|
| XFileTemplate * | get_template () const |
| | If get_data_type() returned T_template, this returns the particular template pointer that this object represents.
|
|
virtual TypeHandle | get_type () const |
| virtual bool | matches (const XFileNode *other) const |
| | Returns true if the node, particularly a template node, is structurally equivalent to the other node (which must be of the same type).
|
| virtual bool | repack_data (XFileDataObject *object, const XFileParseDataList &parse_data_list, PrevData &prev_data, size_t &index, size_t &sub_index) const |
| | This is called on the template that defines an object, once the data for the object has been parsed.
|
| 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 () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
Detailed Description
A definition of a single data element appearing within a template record.
This class represents the definition* of the data element (e.g. DWORD nVertices); see XFileDataObject for its *value* (e.g. 12).
Definition at line 35 of file xFileDataDef.h.
Member Function Documentation
Adds an additional array dimension to the data description.
Definition at line 56 of file xFileDataDef.cxx.
Removes all children from the node, and otherwise resets it to its initial state.
Reimplemented from XFileNode.
Definition at line 44 of file xFileDataDef.cxx.
Returns the description of the nth dimension of array elements on this data object.
Definition at line 73 of file xFileDataDef.I.
Referenced by matches().
Returns the primitive type of this element, or T_template if this represents a nested template object.
Definition at line 38 of file xFileDataDef.I.
Referenced by matches().
Returns the number of dimensions of array elements on this data object, or 0 if the data object is not an array.
Definition at line 62 of file xFileDataDef.I.
Referenced by matches().
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from XFileNode.
Definition at line 125 of file xFileDataDef.h.
This is called on the template that defines an object, once the data for the object has been parsed.
It is responsible for identifying which component of the template owns each data element, and packing the data elements appropriately back into the object.
It returns true on success, or false on an error (e.g. not enough data elements, mismatched data type).
Reimplemented from XFileNode.
Definition at line 150 of file xFileDataDef.cxx.
The documentation for this class was generated from the following files:
| | |