Wolframe, 0.0.3

normalizeFunctionBuilder.hpp
Go to the documentation of this file.
1 /************************************************************************
2 Copyright (C) 2011 - 2014 Project Wolframe.
3 All rights reserved.
4 
5 This file is part of Project Wolframe.
6 
7 Commercial Usage
8 Licensees holding valid Project Wolframe Commercial licenses may
9 use this file in accordance with the Project Wolframe
10 Commercial License Agreement provided with the Software or,
11 alternatively, in accordance with the terms contained
12 in a written agreement between the licensee and Project Wolframe.
13 
14 GNU General Public License Usage
15 Alternatively, you can redistribute this file and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19 
20 Wolframe is distributed in the hope that it will be useful,
21 but WITHOUT ANY WARRANTY; without even the implied warranty of
22 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 GNU General Public License for more details.
24 
25 You should have received a copy of the GNU General Public License
26 along with Wolframe. If not, see <http://www.gnu.org/licenses/>.
27 
28 If you have questions regarding the use of this file, please contact
29 Project Wolframe.
30 
31 ************************************************************************/
34 #ifndef _Wolframe_MODULE_NORMALIZE_FUNCTION_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
35 #define _Wolframe_MODULE_NORMALIZE_FUNCTION_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
37 #include "types/keymap.hpp"
39 #include "module/constructor.hpp"
40 #include <boost/shared_ptr.hpp>
41 
42 namespace _Wolframe {
43 namespace module {
44 
48  :public SimpleObjectConstructor< types::NormalizeFunctionType >
49 {
50 public:
51  NormalizeFunctionConstructor( const char* classname_, const std::string& identifier_, const types::NormalizeFunctionType& function_)
52  :m_classname(classname_)
53  ,m_identifier(identifier_)
54  ,m_function(function_)
55  {}
56 
58  {}
59 
61  {
63  }
64 
65  virtual const char* objectClassName() const
66  {
67  return m_classname;
68  }
69 
70  const std::string& identifier() const
71  {
72  return m_identifier;
73  }
74 
75  const types::NormalizeFunctionType& function() const
76  {
77  return m_function;
78  }
79 
81  {
83  }
84 
85 private:
86  const char* m_classname;
87  std::string m_identifier;
89 };
90 
91 typedef boost::shared_ptr<NormalizeFunctionConstructor> NormalizeFunctionConstructorR;
92 
93 
97 {
98 public:
104  NormalizeFunctionBuilder( const char* classname_, const char* identifier_, types::CreateNormalizeFunction createFunc_, const types::NormalizeResourceHandleR& resource_)
105  :SimpleBuilder( classname_),m_identifier(identifier_),m_function(types::NormalizeFunctionType(createFunc_,resource_))
106  {}
111  NormalizeFunctionBuilder( const char* classname_, const char* identifier_, types::CreateNormalizeFunction createFunc_)
112  :SimpleBuilder( classname_),m_identifier(identifier_),m_function(types::NormalizeFunctionType(createFunc_))
113  {}
114 
116  {}
117 
119  {
121  }
122 
124  {
126  }
127 
128 private:
129  std::string m_identifier;
131 };
132 
133 }}//namespace
134 
135 #endif
136 
Base classes for virtual constructors to build objects loaded from modules.
Class of basic normalization functions instantiated by arguments.
Definition: normalizeFunction.hpp:81
const std::string & identifier() const
Definition: normalizeFunctionBuilder.hpp:70
NormalizeFunctionBuilder(const char *classname_, const char *identifier_, types::CreateNormalizeFunction createFunc_)
Constructor.
Definition: normalizeFunctionBuilder.hpp:111
Normalize function definition.
virtual ObjectConstructorBase::ObjectType objectType() const
Definition: normalizeFunctionBuilder.hpp:118
const char * m_classname
Definition: normalizeFunctionBuilder.hpp:86
types::NormalizeFunctionType m_function
Definition: normalizeFunctionBuilder.hpp:88
types::NormalizeFunctionType * object() const
Definition: normalizeFunctionBuilder.hpp:80
NormalizeFunction *(* CreateNormalizeFunction)(NormalizeResourceHandle *reshnd, const std::vector< types::Variant > &arg)
Definition: normalizeFunction.hpp:77
ObjectType
Definition: constructor.hpp:47
const char * m_className
Definition: moduleInterface.hpp:78
Builder of a normalization function type constructor.
Definition: normalizeFunctionBuilder.hpp:96
NormalizeFunctionConstructor(const char *classname_, const std::string &identifier_, const types::NormalizeFunctionType &function_)
Definition: normalizeFunctionBuilder.hpp:51
std::string m_identifier
Definition: normalizeFunctionBuilder.hpp:129
Constructor of a normalization function type.
Definition: normalizeFunctionBuilder.hpp:47
boost::shared_ptr< NormalizeFunctionConstructor > NormalizeFunctionConstructorR
Definition: normalizeFunctionBuilder.hpp:91
Basic interface classes that to build objects and the Wolframe module interface.
Constructor of a simple (without configuration) object.
Definition: constructor.hpp:116
virtual ObjectConstructorBase::ObjectType objectType() const
The type of the object. Filter, DDL compiler, authentication etc.
Definition: normalizeFunctionBuilder.hpp:60
boost::shared_ptr< NormalizeResourceHandle > NormalizeResourceHandleR
Definition: normalizeFunction.hpp:73
Base class for builders of objects without configuration.
Definition: moduleInterface.hpp:63
virtual ~NormalizeFunctionConstructor()
Definition: normalizeFunctionBuilder.hpp:57
template for map with case insensitive key strings
std::string m_identifier
Definition: normalizeFunctionBuilder.hpp:87
virtual const char * objectClassName() const
Definition: normalizeFunctionBuilder.hpp:65
types::NormalizeFunctionType m_function
Definition: normalizeFunctionBuilder.hpp:130
Constructor base class.
Definition: constructor.hpp:44
virtual ObjectConstructorBase * constructor()
Definition: normalizeFunctionBuilder.hpp:123
virtual ~NormalizeFunctionBuilder()
Definition: normalizeFunctionBuilder.hpp:115
NormalizeFunctionBuilder(const char *classname_, const char *identifier_, types::CreateNormalizeFunction createFunc_, const types::NormalizeResourceHandleR &resource_)
Constructor.
Definition: normalizeFunctionBuilder.hpp:104