Panda3D
|
00001 // Filename: xFileArrayDef.h 00002 // Created by: drose (03Oct04) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef XFILEARRAYDEF_H 00016 #define XFILEARRAYDEF_H 00017 00018 #include "pandatoolbase.h" 00019 #include "pnotify.h" 00020 #include "xFileNode.h" 00021 00022 class XFileDataDef; 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Class : XFileArrayDef 00026 // Description : Defines one level of array bounds for an associated 00027 // XFileDataDef element. 00028 //////////////////////////////////////////////////////////////////// 00029 class XFileArrayDef { 00030 public: 00031 INLINE XFileArrayDef(int fixed_size); 00032 INLINE XFileArrayDef(XFileDataDef *dynamic_size); 00033 00034 INLINE bool is_fixed_size() const; 00035 INLINE int get_fixed_size() const; 00036 INLINE XFileDataDef *get_dynamic_size() const; 00037 00038 int get_size(const XFileNode::PrevData &prev_data) const; 00039 00040 void output(ostream &out) const; 00041 00042 bool matches(const XFileArrayDef &other, const XFileDataDef *parent, 00043 const XFileDataDef *other_parent) const; 00044 00045 private: 00046 int _fixed_size; 00047 XFileDataDef *_dynamic_size; 00048 }; 00049 00050 #include "xFileArrayDef.I" 00051 00052 #endif 00053 00054 00055