Panda3D
 All Classes Functions Variables Enumerations
factoryParams.h
1 // Filename: factoryParams.h
2 // Created by: drose (08May00)
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 FACTORYPARAMS_H
16 #define FACTORYPARAMS_H
17 
18 #include "pandabase.h"
19 
20 #include "typedObject.h"
21 #include "typedReferenceCount.h"
22 #include "pointerTo.h"
23 #include "factoryParam.h"
24 #include "dcast.h"
25 
26 #include "pvector.h"
27 
28 ////////////////////////////////////////////////////////////////////
29 // Class : FactoryParams
30 // Description : An instance of this class is passed to the Factory
31 // when requesting it to do its business and construct a
32 // new something. It can be filled with optional
33 // parameters to the CreateFunc for the particular
34 // subclass the Factory will be creating.
35 //
36 // This is just a vector of pointers to *something*; it
37 // will be up to the individual CreateFuncs to interpret
38 // this meaningfully.
39 ////////////////////////////////////////////////////////////////////
40 class EXPCL_PANDA_PUTIL FactoryParams {
41 public:
42  FactoryParams();
43  ~FactoryParams();
44 
45  void add_param(FactoryParam *param);
46  void clear();
47 
48  int get_num_params() const;
49  FactoryParam *get_param(int n) const;
50 
51  FactoryParam *get_param_of_type(TypeHandle type) const;
52 
53 private:
55 
56  Params _params;
57 };
58 
59 template<class ParamType>
60 INLINE bool get_param_into(ParamType *&pointer, const FactoryParams &params);
61 
62 #include "factoryParams.I"
63 
64 #endif
The base class of any number of specific pieces of parameter information that might be passed to a Fa...
Definition: factoryParam.h:34
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85