Wolframe, 0.0.3

cppFormFunctionBuilder.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_CPP_FORM_FUNCTION_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
35 #define _Wolframe_MODULE_CPP_FORM_FUNCTION_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
38 #include "module/constructor.hpp"
39 #include "types/keymap.hpp"
40 #include <boost/shared_ptr.hpp>
41 
42 namespace _Wolframe {
43 namespace module {
44 
45 
49 {
50  const char* name;
52 };
53 
56 class CppFormFunctionConstructor :public SimpleObjectConstructor< serialize::CppFormFunction >
57 {
58 public:
59  CppFormFunctionConstructor( const std::string& classname_, const std::string& name_, const serialize::CppFormFunction& function_)
60  :m_classname(classname_),m_name(name_),m_function(function_)
61  {}
62 
64 
66  {
67  return FORM_FUNCTION_OBJECT;
68  }
69 
70  virtual const char* objectClassName() const
71  {
72  return m_classname.c_str();
73  }
74 
75  const std::string& identifier() const
76  {
77  return m_name;
78  }
79 
80  const serialize::CppFormFunction function() const
81  {
82  return m_function;
83  }
84 
86  {
88  }
89 
90 private:
91  std::string m_classname;
92  std::string m_name;
94 };
95 
96 typedef boost::shared_ptr<CppFormFunctionConstructor> CppFormFunctionConstructorR;
97 
98 
102 {
103 public:
104  CppFormFunctionBuilder( const char* className_, const char* name_, const serialize::CppFormFunction& function_)
105  :SimpleBuilder( className_)
106  ,m_name(name_)
107  ,m_function(function_)
108 
109  {}
110 
112 
114  {
116  }
118  {
120  }
121 private:
122  std::string m_name;
124 };
125 
126 }}//namespace
127 
128 #endif
129 
Base classes for virtual constructors to build objects loaded from modules.
serialize::CppFormFunction * object() const
Definition: cppFormFunctionBuilder.hpp:85
Interface to form functions written in C++.
virtual ObjectConstructorBase::ObjectType objectType() const
The type of the object. Filter, DDL compiler, authentication etc.
Definition: cppFormFunctionBuilder.hpp:65
Builder of a form function constructor written in C++.
Definition: cppFormFunctionBuilder.hpp:101
virtual ~CppFormFunctionConstructor()
Definition: cppFormFunctionBuilder.hpp:63
Definition of a form function written in C++.
Definition: cppFormFunctionBuilder.hpp:48
virtual ObjectConstructorBase::ObjectType objectType() const
Definition: cppFormFunctionBuilder.hpp:113
ObjectType
Definition: constructor.hpp:47
const char * m_className
Definition: moduleInterface.hpp:78
CppFormFunctionConstructor(const std::string &classname_, const std::string &name_, const serialize::CppFormFunction &function_)
Definition: cppFormFunctionBuilder.hpp:59
const char * name
Definition: cppFormFunctionBuilder.hpp:50
Basic interface classes that to build objects and the Wolframe module interface.
virtual ObjectConstructorBase * constructor()
Definition: cppFormFunctionBuilder.hpp:117
Constructor of a simple (without configuration) object.
Definition: constructor.hpp:116
virtual ~CppFormFunctionBuilder()
Definition: cppFormFunctionBuilder.hpp:111
serialize::CppFormFunction m_function
Definition: cppFormFunctionBuilder.hpp:123
std::string m_name
Definition: cppFormFunctionBuilder.hpp:92
Base class for builders of objects without configuration.
Definition: moduleInterface.hpp:63
serialize::CppFormFunction m_function
Definition: cppFormFunctionBuilder.hpp:93
template for map with case insensitive key strings
std::string m_classname
Definition: cppFormFunctionBuilder.hpp:91
virtual const char * objectClassName() const
Definition: cppFormFunctionBuilder.hpp:70
Constructor base class.
Definition: constructor.hpp:44
serialize::CppFormFunction func
Definition: cppFormFunctionBuilder.hpp:51
boost::shared_ptr< CppFormFunctionConstructor > CppFormFunctionConstructorR
Definition: cppFormFunctionBuilder.hpp:96
CppFormFunctionBuilder(const char *className_, const char *name_, const serialize::CppFormFunction &function_)
Definition: cppFormFunctionBuilder.hpp:104
const std::string & identifier() const
Definition: cppFormFunctionBuilder.hpp:75
std::string m_name
Definition: cppFormFunctionBuilder.hpp:122
Constructor of a form function written in C++.
Definition: cppFormFunctionBuilder.hpp:56
Function of language bindings implemented in C++ with a form as argument and as result. The forms are defined by a serialization description.
Definition: cppFormFunction.hpp:111