Panda3D
eggNamedObject.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 eggNamedObject.h
10  * @author drose
11  * @date 1999-01-16
12  */
13 
14 #ifndef EGGNAMEDOBJECT_H
15 #define EGGNAMEDOBJECT_H
16 
17 #include "pandabase.h"
18 
19 #include "eggObject.h"
20 #include "namable.h"
21 #include "referenceCount.h"
22 
23 /**
24  * This is a fairly low-level base class--any egg object that has a name.
25  */
26 class EXPCL_PANDA_EGG EggNamedObject : public EggObject, public Namable {
27 PUBLISHED:
28  INLINE explicit EggNamedObject(const std::string &name = "");
29  INLINE EggNamedObject(const EggNamedObject &copy);
30  INLINE EggNamedObject &operator = (const EggNamedObject &copy);
31 
32  void output(std::ostream &out) const;
33 
34 public:
35  void write_header(std::ostream &out, int indent_level,
36  const char *egg_keyword) const;
37 
38 
39  static TypeHandle get_class_type() {
40  return _type_handle;
41  }
42  static void init_type() {
43  EggObject::init_type();
44  Namable::init_type();
45  register_type(_type_handle, "EggNamedObject",
46  EggObject::get_class_type(),
47  Namable::get_class_type());
48  }
49  virtual TypeHandle get_type() const {
50  return get_class_type();
51  }
52  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
53 
54 private:
55  static TypeHandle _type_handle;
56 };
57 
58 INLINE std::ostream &operator << (std::ostream &out, const EggNamedObject &n);
59 
60 #include "eggNamedObject.I"
61 
62 #endif
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void output(std::ostream &out) const
Outputs the Namable.
Definition: namable.I:61
A base class for all things which can have a name.
Definition: namable.h:26
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is a fairly low-level base class–any egg object that has a name.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
The highest-level base class in the egg directory.
Definition: eggObject.h:29