SheafSystem  0.0.0.0
poset_bounds_descriptor.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_bounds_descriptor
19 
20 #ifndef POSET_BOUNDS_DESCRIPTOR_H
21 #define POSET_BOUNDS_DESCRIPTOR_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef ANY_H
28 #include "SheafSystem/any.h"
29 #endif
30 
31 #ifndef POSET_STATE_HANDLE_H
32 #include "SheafSystem/poset_state_handle.h"
33 #endif
34 
35 #ifndef SUBPOSET_H
36 #include "SheafSystem/subposet.h"
37 #endif
38 
39 namespace sheaf
40 {
41 
42 class poset_bounds;
43 
48 class SHEAF_DLL_SPEC poset_bounds_descriptor : public any
49 {
50 
51  friend class poset_bounds; // To get default constructor.
52 
53 public:
54 
60 
64  poset_bounds_descriptor& operator=(const poset_bounds_descriptor& xother);
65 
69  bool operator==(const poset_bounds_descriptor& xother) const;
70 
76  virtual poset_bounds_descriptor* clone() const;
77 
81  virtual ~poset_bounds_descriptor();
82 
86  virtual bool invariant() const;
87 
91  virtual bool is_ancestor_of(const any* other) const;
92 
93  // POSET_BOUNDS_DESCRIPTOR FACET
94 
95 
100  {
101  MEMBER_MEMBER, // lb = member, ub = member
102  MEMBER_SUBPOSET, // lb = member, ub = subposet
103  SUBPOSET_MEMBER, // lb = subposet, ub = member
104  SUBPOSET_SUBPOSET, // lb = subposet, ub = subposet
105  NOT_A_MODE
106  };
107 
111  static int mode_to_int(specification_mode xmode);
112 
116  static specification_mode int_to_mode(int xmode);
117 
122  pod_index_type xlb_id,
123  pod_index_type xub_id);
124 
129  const scoped_index& xlb_id,
130  const scoped_index& xub_id);
131 
135  specification_mode mode() const;
136 
140  bool lb_is_member() const;
141 
145  bool ub_is_member() const;
146 
150  pod_index_type lb_id() const;
151 
155  void put_lb_id(pod_index_type xlb_id);
156 
160  void put_lb_id(const scoped_index& xlb_id);
161 
166  pod_index_type ub_id() const;
167 
171  void put_ub_id(pod_index_type xub_id);
172 
176  void put_ub_id(const scoped_index& xub_id);
181  bool lb_is_valid_for(const poset_state_handle& xposet) const;
182 
187  bool ub_is_valid_for(const poset_state_handle& xposet) const;
188 
193  bool is_valid_for(const poset_state_handle& xposet) const;
194 
198  bool lb_member_is_bottom() const;
199 
203  bool ub_member_is_not_top() const;
204 
209 
214 
215 protected:
216 
221 
222 
223 private:
224 
225  // PRIVATE MEMBERS
226 
230  specification_mode _mode;
231 
235  pod_index_type _lb_id;
236 
242  pod_index_type _ub_id;
243 };
244 
245 } // namespace sheaf
246 
247 #endif // ifndef POSET_BOUNDS_DESCRIPTOR_H
248 
249 
250 
251 
252 
253 
254 
A client handle for a general, abstract partially order set.
A (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bounded i/o operation...
Definition: poset_bounds.h:50
Abstract base class with useful features for all objects.
Definition: any.h:39
specification_mode
Enumeration for mode of specifying the lower and upper bounds.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
static const poset_bounds_descriptor & BOTTOM_TOP
An instance with lb() == {bottom} and ub() == {top}.
static const poset_bounds_descriptor & BOTTOM_BOTTOM
An instance with lb() == {bottom} and ub() == {bottom}.
bool operator==(const singly_linked_list< T, Alloc > &lhs, const singly_linked_list< T, Alloc > &rhs)
Checks if the contents of lhs and rhs are equal, that is, whether lhs.size() == rhs.size() and each element in lhs compares equal with the element in rhs at the same position.
A description of a (lower, upper) bounds pair for a poset. Specifies a portion of a poset for a bound...
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.