GPU-SD  1.0.2
filter.h
00001 
00002 /* Copyright (c) 2011, Stefan Eilemann <eile@eyescale.ch> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef GPUSD_FILTER_H
00019 #define GPUSD_FILTER_H
00020 
00021 #include <gpusd/api.h>
00022 #include <gpusd/types.h>
00023 #include <algorithm>
00024 #include <string>
00025 
00026 #include <iostream>
00027 
00028 namespace gpusd
00029 {
00030 namespace detail
00031 {
00032     class Filter;
00033     class SessionFilter;
00034 }
00036     class Filter
00037     {
00038     public:
00040         GPUSD_API Filter();
00041 
00043         GPUSD_API virtual ~Filter();
00044 
00051         GPUSD_API FilterPtr operator | ( FilterPtr rhs );
00052 
00059         GPUSD_API FilterPtr operator |= ( FilterPtr rhs );
00060 
00073         GPUSD_API virtual bool operator() ( const GPUInfos& current,
00074                                             const GPUInfo& candidate );
00075     private:
00076         detail::Filter* const impl_;
00077     };
00078 
00080     class DuplicateFilter : public Filter
00081     {
00082     public:
00083         virtual ~DuplicateFilter() {}
00084 
00089         GPUSD_API virtual bool operator() ( const GPUInfos& current,
00090                                             const GPUInfo& candidate );
00091     };
00092 
00094     class MirrorFilter : public Filter
00095     {
00096     public:
00097         virtual ~MirrorFilter() {}
00098 
00104         GPUSD_API virtual bool operator() ( const GPUInfos& current,
00105                                             const GPUInfo& candidate );
00106     };
00107 
00109     class SessionFilter : public Filter
00110     {
00111     public:
00112         GPUSD_API SessionFilter( const std::string& name );
00113         GPUSD_API virtual ~SessionFilter();
00114 
00116         GPUSD_API virtual bool operator() ( const GPUInfos& current,
00117                                             const GPUInfo& candidate );
00118     private:
00119         detail::SessionFilter* const impl_;
00120     };
00121 }
00122 #endif // GPUSD_FILTER_H
00123 
Generated on Tue Dec 13 2011 17:52:00 for GPU-SD 1.0.2 by  doxygen 1.7.5.1