Panda3D
|
00001 // Filename: iffGenericChunk.h 00002 // Created by: drose (23Apr01) 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 IFFGENERICCHUNK_H 00016 #define IFFGENERICCHUNK_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "iffChunk.h" 00021 00022 #include "datagram.h" 00023 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : IffGenericChunk 00027 // Description : A class for a generic kind of IffChunk that is not 00028 // understood by a particular IffReader. It remembers 00029 // its entire contents. 00030 //////////////////////////////////////////////////////////////////// 00031 class IffGenericChunk : public IffChunk { 00032 public: 00033 INLINE IffGenericChunk(); 00034 00035 INLINE const Datagram &get_data() const; 00036 INLINE void set_data(const Datagram &data); 00037 00038 virtual bool read_iff(IffInputFile *in, size_t stop_at); 00039 virtual void write(ostream &out, int indent_level = 0) const; 00040 00041 private: 00042 Datagram _data; 00043 00044 public: 00045 virtual TypeHandle get_type() const { 00046 return get_class_type(); 00047 } 00048 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00049 static TypeHandle get_class_type() { 00050 return _type_handle; 00051 } 00052 static void init_type() { 00053 IffChunk::init_type(); 00054 register_type(_type_handle, "IffGenericChunk", 00055 IffChunk::get_class_type()); 00056 } 00057 00058 private: 00059 static TypeHandle _type_handle; 00060 }; 00061 00062 #include "iffGenericChunk.I" 00063 00064 #endif 00065 00066