15 #ifndef XFILEDATADEF_H 16 #define XFILEDATADEF_H 18 #include "pandatoolbase.h" 20 #include "xFileNode.h" 21 #include "xFileArrayDef.h" 22 #include "xFileTemplate.h" 23 #include "xFileDataObject.h" 25 #include "pointerTo.h" 54 virtual ~XFileDataDef();
65 virtual void write_text(ostream &out,
int indent_level)
const;
70 size_t &index,
size_t &sub_index)
const;
80 size_t &index,
size_t &sub_index)
const;
82 (XFileDataDef::*ZeroFillMethod)()
const;
87 size_t &index,
size_t &sub_index)
const;
91 size_t &index,
size_t &sub_index)
const;
95 size_t &index,
size_t &sub_index)
const;
99 size_t &index,
size_t &sub_index)
const;
104 size_t &index,
size_t &sub_index,
105 UnpackMethod unpack_method)
const;
112 zero_fill_value(
int array_index, ZeroFillMethod zero_fill_method)
const;
125 static void init_type() {
126 XFileNode::init_type();
127 register_type(_type_handle,
"XFileDataDef",
128 XFileNode::get_class_type());
131 return get_class_type();
133 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
139 #include "xFileDataDef.I" This is our own Panda specialization on the default STL map.
void add_array_def(const XFileArrayDef &array_def)
Adds an additional array dimension to the data description.
virtual void write_text(ostream &out, int indent_level) const
Writes a suitable representation of this node to an .x file in text mode.
Defines one level of array bounds for an associated XFileDataDef element.
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 no...
A definition of a single data element appearing within a template record.
virtual bool matches(const XFileNode *other) const
Returns true if the node, particularly a template node, is structurally equivalent to the other node ...
Type get_data_type() const
Returns the primitive type of this element, or T_template if this represents a nested template object...
A single node of an X file.
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...
XFileTemplate * get_template() const
If get_data_type() returned T_template, this returns the particular template pointer that this object...
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 te...
A container for a pvector of the above objects.
virtual void clear()
Removes all children from the node, and otherwise resets it to its initial state. ...
This represents the complete contents of an X file (file.x) in memory.
A template definition in the X file.
TypeHandle is the identifier used to differentiate C++ class types.
const XFileArrayDef & get_array_def(int i) const
Returns the description of the nth dimension of array elements on this data object.
The abstract base class for a number of different types of data elements that may be stored in the X ...