Wolframe, 0.0.3

filterdef.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 
35 #ifndef _Wolframe_FILTER_FILTERDEF_HPP_INCLUDED
36 #define _Wolframe_FILTER_FILTERDEF_HPP_INCLUDED
37 #include "filter/filter.hpp"
38 #include "types/variant.hpp"
40 #include <string>
41 #include <vector>
42 
43 namespace _Wolframe {
44 namespace langbind {
45 
48 struct FilterDef
49 {
51  std::vector<langbind::FilterArgument> arg;
52 
54  :filtertype(0){}
55  FilterDef( const FilterDef& o)
56  :filtertype(o.filtertype),arg(o.arg){}
57 
58  static FilterDef parse( std::string::const_iterator& si, const std::string::const_iterator& se, const proc::ProcessorProviderInterface* provider);
59 
61  {
62  return filtertype->create( arg);
63  }
64 };
65 
66 }}//namespace
67 #endif
68 
Structure defining a filter for input and output as unit.
Definition: filter.hpp:49
Abstract class as processor provider interface.
Definition: procProviderInterface.hpp:81
Definition of a filter with methods to parse it from a source.
Definition: filterdef.hpp:48
virtual Filter * create(const std::vector< FilterArgument > &arg=std::vector< FilterArgument >()) const =0
Get a new filter instance.
static FilterDef parse(std::string::const_iterator &si, const std::string::const_iterator &se, const proc::ProcessorProviderInterface *provider)
FilterDef()
Definition: filterdef.hpp:53
Structure defining a type of a filter (used as virtual constructor to create filter instances) ...
Definition: filter.hpp:111
Variant value type.
Interface to processor provider for language bindings and database.
const langbind::FilterType * filtertype
Definition: filterdef.hpp:50
langbind::Filter * create() const
Definition: filterdef.hpp:60
std::vector< langbind::FilterArgument > arg
Definition: filterdef.hpp:51
FilterDef(const FilterDef &o)
Definition: filterdef.hpp:55
Interface for filter class.