Panda3D
 All Classes Functions Variables Enumerations
fltInstanceRef.h
1 // Filename: fltInstanceRef.h
2 // Created by: drose (30Aug00)
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 FLTINSTANCEREF_H
16 #define FLTINSTANCEREF_H
17 
18 #include "pandatoolbase.h"
19 
20 #include "fltBead.h"
21 
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : FltInstanceRef
26 // Description : This bead appears in the hierarchy to refer to a
27 // FltInstanceDefinition node defined elsewhere. It
28 // indicates that the subtree beginning at the
29 // FltInstanceDefinition should be considered to be
30 // instanced here.
31 ////////////////////////////////////////////////////////////////////
32 class FltInstanceRef : public FltBead {
33 public:
34  FltInstanceRef(FltHeader *header);
35 
36  int _instance_index;
37 
39 
40  virtual void write(ostream &out, int indent_level = 0) const;
41 
42 protected:
43  virtual bool extract_record(FltRecordReader &reader);
44  virtual FltError write_record_and_children(FltRecordWriter &writer) const;
45  virtual bool build_record(FltRecordWriter &writer) const;
46 
47 public:
48  virtual TypeHandle get_type() const {
49  return get_class_type();
50  }
51  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  FltBead::init_type();
57  register_type(_type_handle, "FltInstanceRef",
58  FltBead::get_class_type());
59  }
60 
61 private:
62  static TypeHandle _type_handle;
63 };
64 
65 #endif
66 
67 
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
Definition: fltBead.h:33
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to readi...
Definition: fltHeader.h:48
FltInstanceDefinition * get_instance() const
Returns the instance subtree referenced by this node, or NULL if the reference is invalid...
virtual void write(ostream &out, int indent_level=0) const
Writes a multiple-line description of the record and all of its children.
This bead appears in the hierarchy to refer to a FltInstanceDefinition node defined elsewhere...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This special kind of record marks the top node of an instance subtree.