Panda3D
factoryParam.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 factoryParam.h
10  * @author drose
11  * @date 2000-05-08
12  */
13 
14 #ifndef FACTORYPARAM_H
15 #define FACTORYPARAM_H
16 
17 #include "pandabase.h"
18 
19 #include "typedReferenceCount.h"
20 
21 #include "pvector.h"
22 
23 /**
24  * The base class of any number of specific pieces of parameter information
25  * that might be passed to a Factory's CreateFunc to control what kind of
26  * instance is created. This class is empty and contains no data, but
27  * different kinds of factories may expect parameters of various types that
28  * derive from FactoryParam (and do contain data).
29  */
30 class EXPCL_PANDA_PUTIL FactoryParam : public TypedReferenceCount {
31 public:
32  INLINE FactoryParam();
33  INLINE FactoryParam(const FactoryParam &other);
34  INLINE void operator = (const FactoryParam &other);
35  INLINE ~FactoryParam();
36 
37 public:
38  virtual TypeHandle get_type() const {
39  return get_class_type();
40  }
41  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
42  static TypeHandle get_class_type() {
43  return _type_handle;
44  }
45  static void init_type() {
46  TypedReferenceCount::init_type();
47  register_type(_type_handle, "FactoryParam",
48  TypedReferenceCount::get_class_type());
49  }
50 
51 private:
52  static TypeHandle _type_handle;
53 };
54 
55 #include "factoryParam.I"
56 
57 #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.
The base class of any number of specific pieces of parameter information that might be passed to a Fa...
Definition: factoryParam.h:30
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
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