SheafSystem  0.0.0.0
poset_orderer.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 POSET_ORDERER_H
22 #define POSET_ORDERER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POSET_DFT_H
29 #include "SheafSystem/poset_dft.h"
30 #endif
31 
32 #ifndef ZN_TO_BOOL_H
33 #include "SheafSystem/zn_to_bool.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class abstract_poset_member;
40 class subposet;
41 class poset_member;
42 
46 class SHEAF_DLL_SPEC poset_orderer: public poset_dft
47 {
48  // ===========================================================
50  // ===========================================================
52 
53 public:
54 
59 
63  ~poset_orderer();
64 
68  void restore_order(subposet* xlower_bound = 0);
69 
70 protected:
71 
72 private:
73 
78  subposet* _lower_bound;
79 
83  zn_to_bool* _post_visited;
84 
89  bool has_been_post_visited(pod_index_type xindex) const
90  {
91  return ((*_post_visited)[xindex]);
92  };
93 
95 
96 
97  // ===========================================================
99  // ===========================================================
101 
102 public:
103 
104 protected:
105 
109  void previsit_action(abstract_poset_member* xmbr);
110 
115  abstract_poset_member* linked_mbr) {};
116 
120  void postvisit_action(abstract_poset_member* xmbr);
121 
122 private:
123 
125 
126 
127  // ===========================================================
129  // ===========================================================
131 
132 public:
133 
134 protected:
135 
136 private:
137 
139 
140 
141  // ===========================================================
143  // ===========================================================
145 
146 public:
147 
151  virtual bool invariant() const;
152 
153 protected:
154 
155 private:
156 
158 
159 };
160 
161 } // namespace sheaf
162 
163 #endif // ifndef POSET_ORDERER_H
A client handle for a subposet.
Definition: subposet.h:86
A client handle for a general, abstract partially order set.
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.
An abstract client handle for a member of a poset.
Traverser to ensure validity of order relation.
Definition: poset_orderer.h:46
Abstract traverser (internal iterator) for poset which traverses the cover relation graph in depth fi...
Definition: poset_dft.h:44
void link_action(abstract_poset_member *xmbr, abstract_poset_member *linked_mbr)
Link action for member, xmbr; disabled.