Wolframe, 0.0.3

joinfilter.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_JOIN_FILTER_HPP_INCLUDED
35 #define _Wolframe_JOIN_FILTER_HPP_INCLUDED
36 #include "filter/typedfilter.hpp"
37 
38 namespace _Wolframe {
39 namespace langbind {
40 
44  :public TypedInputFilter
45 {
46 public:
48  explicit JoinInputFilter( const char* name_, const TypedInputFilterR& f1, const TypedInputFilterR& f2)
49  :TypedInputFilter(name_)
50  ,m_inputfilter1(f1)
51  ,m_inputfilter2(f2)
53  ,m_taglevel(0)
54  {
55  TypedInputFilter::setFlags( f1->flags());
56  TypedInputFilter::setFlags( f2->flags());
57  }
58 
67  {}
68 
70  virtual ~JoinInputFilter(){}
71 
74  virtual TypedInputFilter* copy() const {return new JoinInputFilter(*this);}
75 
77  virtual bool getNext( ElementType& type, types::VariantConst& element);
78 
80  virtual void resetIterator();
81 
83  virtual bool setFlags( Flags f);
84 
86  virtual bool checkSetFlags( Flags f) const;
87 
89  virtual const char* getError() const;
90 
91 private:
92  bool getNextImpl( TypedInputFilter* flt, ElementType& type, types::VariantConst& element);
93 
96 
97  enum JoinState
98  {
104  };
107 };
108 
109 }}//namespace
110 #endif
111 
112 
int m_taglevel
Definition: joinfilter.hpp:106
virtual bool setFlags(Flags f)
Implementation of TypedInputFilter::setFlags(Flags)
virtual TypedInputFilter * copy() const
Get a self copy.
Definition: joinfilter.hpp:74
Definition: joinfilter.hpp:99
virtual ~JoinInputFilter()
Destructor.
Definition: joinfilter.hpp:70
virtual const char * getError() const
Get the last error.
TypedInputFilterR m_inputfilter2
Definition: joinfilter.hpp:95
Input filter as join of two input filters.
Definition: joinfilter.hpp:43
Flags
Definition: filterbase.hpp:106
virtual bool checkSetFlags(Flags f) const
Implements FilterBase::checkSetFlags()const.
Definition: joinfilter.hpp:103
Variant value type that represents a variant copy without content ownership.
Definition: variant.hpp:286
virtual void resetIterator()
Set the iterator to the start (if implemented)
boost::shared_ptr< TypedInputFilter > TypedInputFilterR
Shared input filter (langbind::TypedInputFilter) reference.
Definition: typedfilter.hpp:98
virtual bool setFlags(Flags f)
Set a flag (or a set of flags)
Definition: filterbase.hpp:124
ElementType
Content element type that describes the role of the element in the structured input.
Definition: filterbase.hpp:66
JoinInputFilter(const char *name_, const TypedInputFilterR &f1, const TypedInputFilterR &f2)
Constructor.
Definition: joinfilter.hpp:48
bool getNextImpl(TypedInputFilter *flt, ElementType &type, types::VariantConst &element)
JoinState m_joinstate
Definition: joinfilter.hpp:105
virtual bool getNext(ElementType &type, types::VariantConst &element)
Implementation of TypedInputFilter::getNext(ElementType&,types::VariantConst&)
TypedInputFilterR m_inputfilter1
Definition: joinfilter.hpp:94
JoinInputFilter(const JoinInputFilter &o)
Copy constructor.
Definition: joinfilter.hpp:61
JoinState
Definition: joinfilter.hpp:97
Typed interface for input/output filter.
Input filter with atomic values having a type.
Definition: typedfilter.hpp:48