SheafSystem  0.0.0.0
poset_dft.h
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 
18 // Interface for class POSET_DFT
19 
20 #ifndef POSET_DFT_H
21 #define POSET_DFT_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef POSET_TRAVERSER_H
28 #include "SheafSystem/poset_traverser.h"
29 #endif
30 
31 #ifndef STD_STACK_H
32 #include "SheafSystem/std_stack.h"
33 #endif
34 
35 namespace sheaf
36 {
37 
38 class abstract_poset_member;
39 
44 class SHEAF_DLL_SPEC poset_dft: public poset_traverser
45 {
46 
47 public:
48 
49  // Class invariant same as base class
50 
51  // Constructors:
52 
56  poset_dft(const poset_state_handle* xhost);
57 
61  ~poset_dft();
62 
63 
64 protected:
65 
70  bool _descend;
71 
76  std::stack<abstract_poset_member*> _free_mbrs;
77 
78  // actions:
79 
80  void private_traverse();
81  void recursive_dft(abstract_poset_member* xmbr);
82  virtual void previsit_action(abstract_poset_member* xmbr) = 0;
83  virtual void link_action(abstract_poset_member* xgreater, abstract_poset_member* xlesser) = 0;
84  virtual void postvisit_action(abstract_poset_member* xmbr) = 0;
85 
86 
87 };
88 
89 } // namespace sheaf
90 
91 #endif // ifndef POSET_DFT_H
A client handle for a general, abstract partially order set.
Abstract traverser (internal iterator) for poset.
bool _descend
If true on return from previsit_action, descend into lower cover previsit_action can truncate dft by ...
Definition: poset_dft.h:70
std::stack< abstract_poset_member * > _free_mbrs
Storage for abstract_poset_member objects, so we can reuse them, rather than creating one for each me...
Definition: poset_dft.h:76
Namespace for the sheaves component of the sheaf system.
An abstract client handle for a member of a poset.
Abstract traverser (internal iterator) for poset which traverses the cover relation graph in depth fi...
Definition: poset_dft.h:44