VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
factoryTemplate.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include <vrfutil/vrfutilDefines.h>
14 #include <map>
15 
16 #include <vlutil/vlString.h>
17 
28 template <typename T_CreationObject, typename T_Key>
30 {
31 public:
34 
35 private:
40  orig);
41 
42 public:
43  typedef T_CreationObject* (*DtCreatorFcn)();
44 
48  };
49 
50  typedef std::map<T_Key, DtFactoryTemplateEntry> DtCreatorMapType;
51 
53  virtual ~DtFactoryTemplate();
54 
56  virtual void addCreatorFcn(const T_Key& key, DtCreatorFcn fcn);
57 
60  virtual bool removeCreatorFcn(const T_Key& key);
61 
65 
66  virtual T_CreationObject* createNew(const T_Key& key) const;
68 
69  virtual bool isKeyRegistered(const T_Key& key) const;
70 
72 
76  virtual DtString creationObjectName() const;
77 
78  virtual const DtCreatorMapType& creatorMap() const;
79 
80 protected:
81 
83 };
84 
86 
89 template <typename T_CreationObject, typename T_Key, typename T_Arg>
91 {
92 public:
95 
96 private:
101  orig);
102 
103 public:
104  typedef T_CreationObject* (*DtCreatorFcn)(T_Arg);
105 
109  };
110 
111  typedef std::map<T_Key, DtSingleArgFactoryTemplateEntry> DtCreatorMapType;
112 
114  virtual ~DtSingleArgFactoryTemplate();
115 
117  virtual void addCreatorFcn(const T_Key& key, DtCreatorFcn fcn);
118 
121  virtual bool removeCreatorFcn(const T_Key& key);
122 
126 
127  virtual T_CreationObject* createNew(const T_Key& key, T_Arg arg) const;
129 
130  virtual bool isKeyRegistered(const T_Key& key) const;
131 
133 
137  virtual DtString creationObjectName() const;
138 
139  virtual const DtCreatorMapType& creatorMap() const;
140 
141 protected:
142 
144 };
145 
146 #define factoryTemplate_inl_
147 #include "vrfutil/factoryTemplate.inl"
148 #undef factoryTemplate_inl_

Document ID: Generated on Mon Jul 4 01:00:18 EDT 2016 from SVN revision 166489
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)