Panda3D
writableParam.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 writableParam.h
10  * @author jason
11  * @date 2000-06-13
12  */
13 
14 #ifndef WRITABLEPARAM_H
15 #define WRITABLEPARAM_H
16 
17 #include "pandabase.h"
18 
19 #include "factoryParam.h"
20 #include "datagram.h"
21 
22 #include "pvector.h"
23 
24 /**
25  * The specific derivation of FactoryParam that contains the information
26  * needed by a TypedWritable object. Simply contains a Datagram for the
27  * object to construct itself from.
28  */
29 class EXPCL_PANDA_PUTIL WritableParam : public FactoryParam {
30 public:
31  INLINE const Datagram &get_datagram();
32 
33 private:
34  const Datagram &_packet;
35 
36 public:
37  INLINE WritableParam(const Datagram &datagram);
38  INLINE WritableParam(const WritableParam &other);
39 
40 private:
41  // The assignment operator cannot be used for this class.
42  WritableParam &operator = (const WritableParam &other) = delete;
43 
44 public:
45  virtual TypeHandle get_type() const {
46  return get_class_type();
47  }
48  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
49  static TypeHandle get_class_type() {
50  return _type_handle;
51  }
52  static void init_type() {
53  FactoryParam::init_type();
54  register_type(_type_handle, "WritableParam",
55  FactoryParam::get_class_type());
56  }
57 
58 private:
59  static TypeHandle _type_handle;
60 };
61 
62 #include "writableParam.I"
63 
64 #endif
The specific derivation of FactoryParam that contains the information needed by a TypedWritable objec...
Definition: writableParam.h:29
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.
The base class of any number of specific pieces of parameter information that might be passed to a Fa...
Definition: factoryParam.h:30
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:38