Wolframe, 0.0.3

filterBuilder.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_FILTER_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
35 #define _Wolframe_MODULE_FILTER_OBJECT_BUILDER_TEMPLATE_HPP_INCLUDED
36 #include "filter/filter.hpp"
38 #include "module/constructor.hpp"
39 #include <boost/shared_ptr.hpp>
40 
41 namespace _Wolframe {
42 namespace module {
43 
47  :public SimpleObjectConstructor<langbind::FilterType>
48 {
49 public:
50  FilterConstructor( const std::string& name_, langbind::CreateFilterType createFilterType_)
51  : m_name(name_)
52  , m_createFilterType(createFilterType_) {}
53 
54  virtual ~FilterConstructor(){}
55 
57  {
58  return FILTER_OBJECT;
59  }
60  virtual const char* objectClassName() const
61  {
62  return m_name.c_str();
63  }
64  virtual langbind::FilterType* object() const
65  {
66  return m_createFilterType();
67  }
68  const std::string& name() const
69  {
70  return m_name;
71  }
72 
73 private:
74  std::string m_name;
76 };
77 
78 typedef boost::shared_ptr<FilterConstructor> FilterConstructorR;
79 
80 
84  :public SimpleBuilder
85 {
86 public:
87  FilterBuilder( const char* className_, const char* name_, langbind::CreateFilterType createFilterType_)
88  :SimpleBuilder( className_)
89  ,m_createFilterType(createFilterType_)
90  ,m_name(name_){}
91 
92  virtual ~FilterBuilder(){}
93 
95  {
97  }
99  {
101  }
102 
103 private:
105  std::string m_name;
106 };
107 
108 }}//namespace
109 
110 #endif
111 
Base classes for virtual constructors to build objects loaded from modules.
virtual ~FilterBuilder()
Definition: filterBuilder.hpp:92
boost::shared_ptr< FilterConstructor > FilterConstructorR
Definition: filterBuilder.hpp:78
FilterType *(* CreateFilterType)()
Filter type constructor function.
Definition: filter.hpp:136
virtual ObjectConstructorBase * constructor()
Definition: filterBuilder.hpp:98
virtual const char * objectClassName() const
Definition: filterBuilder.hpp:60
Constructor of a filter type.
Definition: filterBuilder.hpp:46
virtual ObjectConstructorBase::ObjectType objectType() const
The type of the object. Filter, DDL compiler, authentication etc.
Definition: filterBuilder.hpp:56
Builder of a filter type constructor.
Definition: filterBuilder.hpp:83
virtual ObjectConstructorBase::ObjectType objectType() const
Definition: filterBuilder.hpp:94
ObjectType
Definition: constructor.hpp:47
std::string m_name
Definition: filterBuilder.hpp:74
Basic interface classes that to build objects and the Wolframe module interface.
Structure defining a type of a filter (used as virtual constructor to create filter instances) ...
Definition: filter.hpp:111
Constructor of a simple (without configuration) object.
Definition: constructor.hpp:116
Base class for builders of objects without configuration.
Definition: moduleInterface.hpp:63
std::string m_name
Definition: filterBuilder.hpp:105
virtual langbind::FilterType * object() const
Definition: filterBuilder.hpp:64
FilterBuilder(const char *className_, const char *name_, langbind::CreateFilterType createFilterType_)
Definition: filterBuilder.hpp:87
FilterConstructor(const std::string &name_, langbind::CreateFilterType createFilterType_)
Definition: filterBuilder.hpp:50
Constructor base class.
Definition: constructor.hpp:44
virtual ~FilterConstructor()
Definition: filterBuilder.hpp:54
const std::string & name() const
Definition: filterBuilder.hpp:68
langbind::CreateFilterType m_createFilterType
Definition: filterBuilder.hpp:75
Interface for filter class.
langbind::CreateFilterType m_createFilterType
Definition: filterBuilder.hpp:104