BALL 1.5.0
Loading...
Searching...
No Matches
processor.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4
5#ifndef BALL_CONCEPT_PROCESSOR_H
6#define BALL_CONCEPT_PROCESSOR_H
7
8#ifndef BALL_COMMON_H
9# include <BALL/common.h>
10#endif
11
12#ifndef BALL_CONCEPT_BASEFUNCTOR_H
14#endif
15
16#ifndef BALL_COMMON_GLOBAL_H
17# include <BALL/COMMON/global.h>
18#endif
19
20namespace BALL
21{
22
28
32 {
33 public:
36 typedef int Result;
37
40 enum
41 {
44 ABORT = 0,
47 BREAK = 1,
50 CONTINUE = 2
51 };
52 };
53
54
57 template <typename T>
59 : public UnaryFunctor<T, Processor::Result>
60 {
61 public:
62
70 {
71 }
72
76 (const UnaryProcessor& /* processor */)
77 {
78 }
79
83 {
84 }
86
92 virtual bool start()
93 {
94 return true;
95 }
96
99 virtual bool finish()
100 {
101 return true;
102 }
103
107 {
108 return Processor::CONTINUE;
109 }
111 };
112
118 template<typename T>
119 class ConstUnaryProcessor : public UnaryFunctor<T, Processor::Result>
120 {
121 public:
123
125 {
126 }
127
128 virtual bool start()
129 {
130 return true;
131 }
132
133 virtual bool finish()
134 {
135 return true;
136 }
137
139 {
140 return Processor::CONTINUE;
141 }
142 };
143
146 template <typename T1, typename T2>
148 : public BinaryFunctor<T1, T2, Processor::Result>
149 {
150 public:
151
156
157
160 {
161 }
162
166 (const BinaryProcessor& /* processor */)
167 {
168 }
169
173 {
174 }
176
180
183 virtual bool start()
184 {
185 return true;
186 }
187
190 virtual bool finish()
191 {
192 return true;
193 }
194
198 {
199 return Processor::CONTINUE;
200 }
202 };
203
204 template <typename T1, typename T2>
206 : public BinaryFunctor<T1, T2, Processor::Result>
207 {
208 public:
209
214
215
218 {
219 }
221
225
228 virtual bool start()
229 {
230 return true;
231 }
232
235 virtual bool finish()
236 {
237 return true;
238 }
239
242 virtual Processor::Result operator () (const T1&, const T2&)
243 {
244 return Processor::CONTINUE;
245 }
247 };
248
250// required for MSVC 12/2013 (TODO remove)
251#ifdef BALL_COMPILER_MSVC
252class Atom;
253template class BALL_EXPORT UnaryProcessor<Atom>;
254template class BALL_EXPORT ConstUnaryProcessor<Atom>;
255#endif
256
257} // namespace BALL
258
259#endif // BALL_CONCEPT_PROCESSOR_H
#define BALL_CREATE(name)
Definition create.h:62
UnaryProcessor(const UnaryProcessor &)
Definition processor.h:76
virtual bool start()
Definition processor.h:92
virtual ~UnaryProcessor()
Definition processor.h:82
virtual bool finish()
Definition processor.h:99
virtual Processor::Result operator()(T &)
Definition processor.h:106
virtual bool finish()
Definition processor.h:133
virtual Processor::Result operator()(const T &)
Definition processor.h:138
virtual ~BinaryProcessor()
Definition processor.h:172
virtual bool finish()
Definition processor.h:190
virtual Processor::Result operator()(T1 &, T2 &)
Definition processor.h:197
BinaryProcessor(const BinaryProcessor &)
Definition processor.h:166
virtual bool start()
Definition processor.h:183
virtual Processor::Result operator()(const T1 &, const T2 &)
Definition processor.h:242
#define BALL_EXPORT