SheafSystem  0.0.0.0
zn_to_bool_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 ZN_TO_BOOL_FILTER_H
22 #define ZN_TO_BOOL_FILTER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ZN_TO_BOOL_H
29 #include "SheafSystem/zn_to_bool.h"
30 #endif
31 
32 //$$SCRIBBLE: jebutler const correctness visited
33 
34 namespace sheaf
35 {
36 
40 class SHEAF_DLL_SPEC zn_to_bool_filter
41 {
42 public:
43 
47  zn_to_bool_filter(const zn_to_bool& xfilter)
48  : _filter(xfilter)
49  {};
50 
54  const zn_to_bool& filter() const
55  {
56  return _filter;
57  };
58 
62  bool operator()(pod_index_type xmbr_index) const
63  {
64  return _filter[xmbr_index];
65  };
66 
67 private:
68 
69  const zn_to_bool& _filter;
70 };
71 
72 } // end namespace sheaf
73 
74 #endif // ifndef ZN_TO_BOOL_FILTER_H
const zn_to_bool & filter() const
The filter.
bool operator()(pod_index_type xmbr_index) const
True if and only if filter() contains xmbr_index.
zn_to_bool_filter(const zn_to_bool &xfilter)
Creates an instance for unordered_set xfilter.
Zn_to_bool implementation of filter concept.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
Definition: zn_to_bool.h:52
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.