Panda3D
 All Classes Functions Variables Enumerations
typedSkel.h
1 // Filename: typedSkel.h
2 // Created by: jyelon (31Jan07)
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 TYPEDSKEL_H
16 #define TYPEDSKEL_H
17 
18 #include "pandabase.h"
19 #include "typedObject.h"
20 
21 ////////////////////////////////////////////////////////////////////
22 // Class : TypedSkel
23 // Description : Skeleton object that inherits from TypedObject.
24 // Stores an integer, and will return it on request.
25 //
26 // The skeleton classes are intended to help you learn
27 // how to add C++ classes to panda. See also the manual,
28 // "Adding C++ Classes to Panda."
29 ////////////////////////////////////////////////////////////////////
30 class EXPCL_PANDASKEL TypedSkel : public TypedObject {
31 PUBLISHED:
32  INLINE TypedSkel();
33  INLINE ~TypedSkel();
34 
35  // These inline functions allow you to get and set _value.
36  INLINE void set_value(int n);
37  INLINE int get_value();
38 
39  // These do the same thing as the functions above.
40  void set_value_alt(int n);
41  int get_value_alt();
42 
43 private:
44  int _value;
45 
46 public:
47  static TypeHandle get_class_type() {
48  return _type_handle;
49  }
50  static void init_type() {
52  register_type(_type_handle, "TypedSkel",
53  TypedObject::get_class_type());
54  }
55  virtual TypeHandle get_type() const {
56  return get_class_type();
57  }
58  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
59 
60 private:
61 
62  static TypeHandle _type_handle;
63 
64 };
65 
66 #include "typedSkel.I"
67 
68 #endif
69 
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:52
Skeleton object that inherits from TypedObject.
Definition: typedSkel.h:30
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