SheafSystem  0.0.0.0
unordered_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 UNORDERED_SET_FILTER_H
22 #define UNORDERED_SET_FILTER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef STD_UNORDERED_SET_H
29 #include "SheafSystem/std_unordered_set.h"
30 #endif
31 
32 #ifndef STD_IOSTREAM_H
33 #include "SheafSystem/std_iostream.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
42 class SHEAF_DLL_SPEC unordered_set_filter
43 {
44 public:
45 
49  unordered_set_filter(const unordered::unordered_set<pod_index_type>& xfilter)
50  : _filter(xfilter)
51  {};
52 
56  const unordered::unordered_set<pod_index_type>& filter() const
57  {
58  return _filter;
59  };
60 
64  bool operator()(pod_index_type xmbr_index) const
65  {
66  return _filter.find(xmbr_index) != _filter.end();
67  };
68 
69 private:
70 
71  const unordered::unordered_set<pod_index_type>& _filter;
72 };
73 
74 } // end namespace sheaf
75 
76 #endif // ifndef UNORDERED_SET_FILTER_H
unordered_set_filter(const unordered::unordered_set< pod_index_type > &xfilter)
Creates an instance for unordered_set xfilter.
bool operator()(pod_index_type xmbr_index) const
True if and only if filter() contains xmbr_index.
Hash set implementation of filter concept.
const unordered::unordered_set< pod_index_type > & filter() const
The filter.
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.