Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
XFileArrayDef Class Reference

Defines one level of array bounds for an associated XFileDataDef element. More...

#include "xFileArrayDef.h"

Public Member Functions

 XFileArrayDef (int fixed_size)
 
 XFileArrayDef (XFileDataDef *dynamic_size)
 
XFileDataDefget_dynamic_size () const
 Returns the data element that names the dynamic size of the array, if is_fixed_size() returned false.
 
int get_fixed_size () const
 Returns the const size of the array, if is_fixed_size() returned true.
 
int get_size (const XFileNode::PrevData &prev_data) const
 Returns the size of the array dimension.
 
bool is_fixed_size () const
 Returns true if this array definition specifies a const-size array, false if it is a dynamic-size array.
 
bool matches (const XFileArrayDef &other, const XFileDataDef *parent, const XFileDataDef *other_parent) const
 Returns true if the node, particularly a template node, is structurally equivalent to the other node (which must be of the same type).
 
void output (std::ostream &out) const
 

Detailed Description

Defines one level of array bounds for an associated XFileDataDef element.

Definition at line 26 of file xFileArrayDef.h.

Constructor & Destructor Documentation

◆ XFileArrayDef() [1/2]

XFileArrayDef::XFileArrayDef ( int fixed_size)
inline

Definition at line 17 of file xFileArrayDef.I.

◆ XFileArrayDef() [2/2]

XFileArrayDef::XFileArrayDef ( XFileDataDef * dynamic_size)
inline

Definition at line 27 of file xFileArrayDef.I.

Member Function Documentation

◆ get_dynamic_size()

XFileDataDef * XFileArrayDef::get_dynamic_size ( ) const
inline

Returns the data element that names the dynamic size of the array, if is_fixed_size() returned false.

Definition at line 56 of file xFileArrayDef.I.

References is_fixed_size().

Referenced by matches().

◆ get_fixed_size()

int XFileArrayDef::get_fixed_size ( ) const
inline

Returns the const size of the array, if is_fixed_size() returned true.

Definition at line 46 of file xFileArrayDef.I.

References is_fixed_size().

Referenced by matches().

◆ get_size()

int XFileArrayDef::get_size ( const XFileNode::PrevData & prev_data) const

Returns the size of the array dimension.

If this is a fixed array, the size is trivial; if it is dynamic, the size is determined by looking up the dynamic_size element in the prev_data table (which lists all of the data values already defined at this scoping level).

Definition at line 24 of file xFileArrayDef.cxx.

References is_fixed_size().

◆ is_fixed_size()

bool XFileArrayDef::is_fixed_size ( ) const
inline

Returns true if this array definition specifies a const-size array, false if it is a dynamic-size array.

Definition at line 38 of file xFileArrayDef.I.

Referenced by get_dynamic_size(), get_fixed_size(), get_size(), and matches().

◆ matches()

bool XFileArrayDef::matches ( const XFileArrayDef & other,
const XFileDataDef * parent,
const XFileDataDef * other_parent ) const

Returns true if the node, particularly a template node, is structurally equivalent to the other node (which must be of the same type).

This checks data element types, but does not compare data element names.

Definition at line 54 of file xFileArrayDef.cxx.

References XFileNode::find_child_index(), get_dynamic_size(), get_fixed_size(), and is_fixed_size().

Referenced by XFileDataDef::matches().

◆ output()

void XFileArrayDef::output ( std::ostream & out) const

Definition at line 40 of file xFileArrayDef.cxx.


The documentation for this class was generated from the following files: