Panda3D
 All Classes Functions Variables Enumerations
savedContext.h
1 // Filename: savedContext.h
2 // Created by: drose (11Jun01)
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 SAVEDCONTEXT_H
16 #define SAVEDCONTEXT_H
17 
18 #include "pandabase.h"
19 
20 #include "typedObject.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : SavedContext
24 // Description : This is the base class for all GSG-specific context
25 // objects, such as TextureContext and GeomContext. It
26 // exists mainly to provide some structural
27 // organization.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDA_GOBJ SavedContext : public TypedObject {
30 public:
31  INLINE SavedContext();
32 
33  virtual void output(ostream &out) const;
34  virtual void write(ostream &out, int indent_level) const;
35 
36 PUBLISHED:
37  static TypeHandle get_class_type() {
38  return _type_handle;
39  }
40 public:
41  static void init_type() {
43  register_type(_type_handle, "SavedContext",
44  TypedObject::get_class_type());
45  }
46  virtual TypeHandle get_type() const {
47  return get_class_type();
48  }
49  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
50 
51 private:
52  static TypeHandle _type_handle;
53 };
54 
55 inline ostream &operator << (ostream &out, const SavedContext &context) {
56  context.output(out);
57  return out;
58 }
59 
60 #include "savedContext.I"
61 
62 #endif
63 
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:52
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:98
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is the base class for all GSG-specific context objects, such as TextureContext and GeomContext...
Definition: savedContext.h:29