Panda3D
eggComment.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 eggComment.h
10  * @author drose
11  * @date 1999-01-20
12  */
13 
14 #ifndef EGGCOMMENT_H
15 #define EGGCOMMENT_H
16 
17 #include "pandabase.h"
18 
19 #include "eggNode.h"
20 
21 /**
22  * A comment that appears in an egg file within a <Comment> entry.
23  */
24 class EXPCL_PANDA_EGG EggComment : public EggNode {
25 PUBLISHED:
26  INLINE explicit EggComment(const std::string &node_name, const std::string &comment);
27  INLINE EggComment(const EggComment &copy);
28 
29  // You can use the string operators to directly set and manipulate the
30  // comment.
31 
32  INLINE EggComment &operator = (const std::string &comment);
33  INLINE EggComment &operator = (const EggComment &copy);
34 
35  INLINE operator const std::string & () const;
36 
37  // Or, you can set and get it explicitly.
38 
39  INLINE void set_comment(const std::string &comment);
40  INLINE std::string get_comment() const;
41 
42  virtual void write(std::ostream &out, int indent_level) const;
43 
44  EXTENSION(PyObject *__reduce__() const);
45 
46 private:
47  std::string _comment;
48 
49 
50 public:
51 
52  static TypeHandle get_class_type() {
53  return _type_handle;
54  }
55  static void init_type() {
56  EggNode::init_type();
57  register_type(_type_handle, "EggComment",
58  EggNode::get_class_type());
59  }
60  virtual TypeHandle get_type() const {
61  return get_class_type();
62  }
63  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
64 
65 private:
66  static TypeHandle _type_handle;
67 };
68 
69 #include "eggComment.I"
70 
71 #endif
A comment that appears in an egg file within a <Comment> entry.
Definition: eggComment.h:24
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:36
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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