Panda3D
savedContext.h
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file savedContext.h
10  * @author drose
11  * @date 2001-06-11
12  */
13 
14 #ifndef SAVEDCONTEXT_H
15 #define SAVEDCONTEXT_H
16 
17 #include "pandabase.h"
18 
19 #include "typedObject.h"
20 
21 /**
22  * This is the base class for all GSG-specific context objects, such as
23  * TextureContext and GeomContext. It exists mainly to provide some
24  * structural organization.
25  */
26 class EXPCL_PANDA_GOBJ SavedContext : public TypedObject {
27 public:
28  INLINE SavedContext();
29 
30  virtual void output(std::ostream &out) const;
31  virtual void write(std::ostream &out, int indent_level) const;
32 
33 PUBLISHED:
34  static TypeHandle get_class_type() {
35  return _type_handle;
36  }
37 public:
38  static void init_type() {
40  register_type(_type_handle, "SavedContext",
41  TypedObject::get_class_type());
42  }
43  virtual TypeHandle get_type() const {
44  return get_class_type();
45  }
46  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
47 
48 private:
49  static TypeHandle _type_handle;
50 };
51 
52 inline std::ostream &operator << (std::ostream &out, const SavedContext &context) {
53  context.output(out);
54  return out;
55 }
56 
57 #include "savedContext.I"
58 
59 #endif
TypedObject::init_type
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:44
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
SavedContext
This is the base class for all GSG-specific context objects, such as TextureContext and GeomContext.
Definition: savedContext.h:26
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
typedObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
savedContext.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypedObject
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:88