HW-SD
1.0.0
Main Page
Namespaces
Classes
Files
File List
install
include
hwsd
filter.h
1
2
/* Copyright (c) 2011-2013, Stefan Eilemann <eile@eyescale.ch>
3
*
4
* This library is free software; you can redistribute it and/or modify it under
5
* the terms of the GNU Lesser General Public License version 2.1 as published
6
* by the Free Software Foundation.
7
*
8
* This library is distributed in the hope that it will be useful, but WITHOUT
9
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11
* details.
12
*
13
* You should have received a copy of the GNU Lesser General Public License
14
* along with this library; if not, write to the Free Software Foundation, Inc.,
15
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16
*/
17
18
#ifndef HWSD_FILTER_H
19
#define HWSD_FILTER_H
20
21
#include <hwsd/api.h>
22
#include <hwsd/types.h>
23
24
#include <lunchbox/referenced.h>
// base class
25
#include <string>
26
27
namespace
hwsd
28
{
29
namespace
detail
30
{
31
class
Filter
;
32
class
SessionFilter
;
33
class
GPUFilter
;
34
class
NetFilter
;
35
}
37
class
Filter
:
public
lunchbox::Referenced
38
{
39
public
:
41
HWSD_API
Filter
();
42
44
HWSD_API
virtual
~Filter
();
45
52
HWSD_API
FilterPtr
operator |
(
FilterPtr
rhs );
53
60
HWSD_API
FilterPtr
operator |=
(
FilterPtr
rhs );
61
74
HWSD_API
virtual
bool
operator()
(
const
GPUInfos
& current,
75
const
GPUInfo
& candidate );
76
77
HWSD_API
virtual
bool
operator()
(
const
NetInfos& current,
78
const
NetInfo
& candidate );
79
private
:
80
detail::Filter*
const
impl_;
81
};
82
84
inline
FilterPtr
operator |
(
FilterPtr
a,
FilterPtr
b )
85
{
return
(*a) |= b; }
86
88
class
DuplicateFilter
:
public
Filter
89
{
90
public
:
91
virtual
~
DuplicateFilter
() {}
92
97
HWSD_API
virtual
bool
operator()
(
const
GPUInfos
& current,
98
const
GPUInfo
& candidate );
99
100
HWSD_API
virtual
bool
operator()
(
const
NetInfos& current,
101
const
NetInfo
& candidate );
102
};
103
105
class
MirrorFilter
:
public
Filter
106
{
107
public
:
108
virtual
~
MirrorFilter
() {}
109
115
HWSD_API
virtual
bool
operator()
(
const
GPUInfos
& current,
116
const
GPUInfo
& candidate );
117
};
118
120
class
SessionFilter
:
public
Filter
121
{
122
public
:
127
HWSD_API
SessionFilter
(
const
std::string& name );
128
HWSD_API
virtual
~SessionFilter();
129
131
HWSD_API
virtual
bool
operator()
(
const
GPUInfos
& current,
132
const
GPUInfo
& candidate );
133
134
HWSD_API
virtual
bool
operator()
(
const
NetInfos& current,
135
const
NetInfo
& candidate );
136
private
:
137
detail::SessionFilter*
const
impl_;
138
};
139
141
class
GPUFilter
:
public
Filter
142
{
143
public
:
148
HWSD_API
GPUFilter
(
const
std::string& regex );
149
HWSD_API
virtual
~GPUFilter();
150
155
HWSD_API
virtual
bool
operator()
(
const
hwsd::GPUInfos
& current,
156
const
hwsd::GPUInfo
& candidate );
157
private
:
158
detail::GPUFilter*
const
impl_;
159
};
160
162
class
NetFilter
:
public
Filter
163
{
164
public
:
165
HWSD_API
NetFilter
(
const
lunchbox::Strings& prefixes,
166
const
uint32_t type );
167
HWSD_API
virtual
~NetFilter();
168
173
HWSD_API
virtual
bool
operator()
(
const
hwsd::NetInfos& current,
174
const
hwsd::NetInfo
& candidate );
175
private
:
176
detail::NetFilter*
const
impl_;
177
};
178
}
179
#endif // HWSD_FILTER_H
Generated on Thu Jun 27 2013 13:28:42 for HW-SD by
1.8.1.2