Panda3D
 All Classes Functions Variables Enumerations
iffGenericChunk.h
1 // Filename: iffGenericChunk.h
2 // Created by: drose (23Apr01)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef IFFGENERICCHUNK_H
16 #define IFFGENERICCHUNK_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "iffChunk.h"
21 
22 #include "datagram.h"
23 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : IffGenericChunk
27 // Description : A class for a generic kind of IffChunk that is not
28 // understood by a particular IffReader. It remembers
29 // its entire contents.
30 ////////////////////////////////////////////////////////////////////
31 class IffGenericChunk : public IffChunk {
32 public:
33  INLINE IffGenericChunk();
34 
35  INLINE const Datagram &get_data() const;
36  INLINE void set_data(const Datagram &data);
37 
38  virtual bool read_iff(IffInputFile *in, size_t stop_at);
39  virtual void write(ostream &out, int indent_level = 0) const;
40 
41 private:
42  Datagram _data;
43 
44 public:
45  virtual TypeHandle get_type() const {
46  return get_class_type();
47  }
48  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
49  static TypeHandle get_class_type() {
50  return _type_handle;
51  }
52  static void init_type() {
53  IffChunk::init_type();
54  register_type(_type_handle, "IffGenericChunk",
55  IffChunk::get_class_type());
56  }
57 
58 private:
59  static TypeHandle _type_handle;
60 };
61 
62 #include "iffGenericChunk.I"
63 
64 #endif
65 
66 
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.
The basic kind of record in an EA "IFF" file, which the LightWave object file is based on...
Definition: iffChunk.h:32
A wrapper around an istream used for reading an IFF file.
Definition: iffInputFile.h:33
const Datagram & get_data() const
Returns the data in the chunk.
void set_data(const Datagram &data)
Changes the data in the chunk.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
A class for a generic kind of IffChunk that is not understood by a particular IffReader.