SheafSystem  0.0.0.0
set_filter.h
Go to the documentation of this file.
1 
2 //
3 // Copyright (c) 2014 Limit Point Systems, Inc.
4 //
5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 
20 
21 #ifndef SET_FILTER_H
22 #define SET_FILTER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef STD_SET_H
29 #include "SheafSystem/std_set.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
38 class SHEAF_DLL_SPEC set_filter
39 {
40 public:
41 
45  set_filter(const std::set<pod_index_type>& xfilter)
46  : _filter(xfilter)
47  {};
48 
52  const std::set<pod_index_type>& filter() const
53  {
54  return _filter;
55  };
56 
60  bool operator()(pod_index_type xmbr_index) const
61  {
62  return _filter.find(xmbr_index) != _filter.end();
63  };
64 
65 private:
66 
67  const std::set<pod_index_type>& _filter;
68 };
69 
70 } // end namespace sheaf
71 
72 #endif // ifndef SET_FILTER_H
Set implementation of filter concept.
Definition: set_filter.h:38
const std::set< pod_index_type > & filter() const
The filter.
Definition: set_filter.h:52
bool operator()(pod_index_type xmbr_index) const
True if and only if filter() contains xmbr_index.
Definition: set_filter.h:60
set_filter(const std::set< pod_index_type > &xfilter)
Creates an instance for unordered_set xfilter.
Definition: set_filter.h:45
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.