BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
CONCEPT
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
13
# include <
BALL/CONCEPT/baseFunctor.h
>
14
#endif
15
16
#ifndef BALL_COMMON_GLOBAL_H
17
# include <
BALL/COMMON/global.h
>
18
#endif
19
20
namespace
BALL
21
{
22
28
31
class
BALL_EXPORT
Processor
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>
58
class
UnaryProcessor
59
:
public
UnaryFunctor
<T, Processor::Result>
60
{
61
public
:
62
66
BALL_CREATE
(
UnaryProcessor
)
69
UnaryProcessor
()
70
{
71
}
72
75
UnaryProcessor
76
(
const
UnaryProcessor
&
/* processor */
)
77
{
78
}
79
82
virtual
~UnaryProcessor
()
83
{
84
}
86
92
virtual
bool
start
()
93
{
94
return
true
;
95
}
96
99
virtual
bool
finish
()
100
{
101
return
true
;
102
}
103
106
virtual
Processor::Result
operator ()
(T &)
107
{
108
return
Processor::CONTINUE
;
109
}
111
};
112
115
template
<
typename
T1,
typename
T2>
116
class
BinaryProcessor
117
:
public
BinaryFunctor
<T1, T2, Processor::Result>
118
{
119
public
:
120
124
BALL_CREATE
(
BinaryProcessor
)
125
126
128
BinaryProcessor
()
129
{
130
}
131
134
BinaryProcessor
135
(
const
BinaryProcessor
&
/* processor */
)
136
{
137
}
138
141
virtual
~BinaryProcessor
()
142
{
143
}
145
149
152
virtual
bool
start
()
153
{
154
return
true
;
155
}
156
159
virtual
bool
finish
()
160
{
161
return
true
;
162
}
163
166
virtual
Processor::Result
operator ()
(T1&, T2&)
167
{
168
return
Processor::CONTINUE
;
169
}
171
};
172
174
// required for visual studio
175
#ifdef BALL_COMPILER_MSVC
176
class
Atom
;
177
template
class
BALL_EXPORT
UnaryProcessor<Atom>;
178
#endif
179
180
}
// namespace BALL
181
182
#endif // BALL_CONCEPT_PROCESSOR_H
Generated by
1.8.3.1