Panda3D
xFileArrayDef.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file xFileArrayDef.h
10  * @author drose
11  * @date 2004-10-03
12  */
13 
14 #ifndef XFILEARRAYDEF_H
15 #define XFILEARRAYDEF_H
16 
17 #include "pandatoolbase.h"
18 #include "pnotify.h"
19 #include "xFileNode.h"
20 
21 class XFileDataDef;
22 
23 /**
24  * Defines one level of array bounds for an associated XFileDataDef element.
25  */
27 public:
28  INLINE XFileArrayDef(int fixed_size);
29  INLINE XFileArrayDef(XFileDataDef *dynamic_size);
30 
31  INLINE bool is_fixed_size() const;
32  INLINE int get_fixed_size() const;
33  INLINE XFileDataDef *get_dynamic_size() const;
34 
35  int get_size(const XFileNode::PrevData &prev_data) const;
36 
37  void output(std::ostream &out) const;
38 
39  bool matches(const XFileArrayDef &other, const XFileDataDef *parent,
40  const XFileDataDef *other_parent) const;
41 
42 private:
43  int _fixed_size;
44  XFileDataDef *_dynamic_size;
45 };
46 
47 #include "xFileArrayDef.I"
48 
49 #endif
This is our own Panda specialization on the default STL map.
Definition: pmap.h:49
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
XFileDataDef * get_dynamic_size() const
Returns the data element that names the dynamic size of the array, if is_fixed_size() returned false.
Definition: xFileArrayDef.I:57
Defines one level of array bounds for an associated XFileDataDef element.
Definition: xFileArrayDef.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A definition of a single data element appearing within a template record.
Definition: xFileDataDef.h:31
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 arr...
Definition: xFileArrayDef.I:39
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_fixed_size() const
Returns the const size of the array, if is_fixed_size() returned true.
Definition: xFileArrayDef.I:47
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 ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.