SheafSystem  0.0.0.0
namespace_poset_member.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 NAMESPACE_POSET_MEMBER_H
22 #define NAMESPACE_POSET_MEMBER_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef TOTAL_POSET_MEMBER_H
29 #include "SheafSystem/total_poset_member.h"
30 #endif
31 
32 #ifndef NAMESPACE_POSET_DOF_MAP_H
33 #include "SheafSystem/namespace_poset_dof_map.h"
34 #endif
35 
36 #ifndef POSET_TYPE_H
37 #include "SheafSystem/poset_type.h"
38 #endif
39 
40 #ifndef STD_STRING_H
41 #include "SheafSystem/std_string.h"
42 #endif
43 
44 namespace sheaf
45 {
46 
47 class poset_state_handle;
48 class namespace_poset;
49 
53 class SHEAF_DLL_SPEC namespace_poset_member : public total_poset_member
54 {
55 
56  friend class poset_state_handle;
57  friend class namespace_poset;
58 
59  // ===========================================================
61  // ===========================================================
63 
64 public:
65 
70 
77  explicit namespace_poset_member(const namespace_poset_member& xother,
78  bool xnew_jem = false);
79 
83  virtual namespace_poset_member& operator=(const abstract_poset_member& xother);
84 
88  namespace_poset_member& operator=(const namespace_poset_member& xother);
89 
93  virtual ~namespace_poset_member();
94 
100  inline namespace_poset_member* clone(bool xnew_state, bool xauto_access = true) const
101  {
102  return static_cast<namespace_poset_member*>(total_poset_member::clone(xnew_state, xauto_access));
103  }
104 
105  // NEW HANDLE, NEW STATE CONSTRUCTORS
106 
113  const scoped_index* xexpansion,
114  int xexpansion_ct,
115  const tern& xnew_jem,
116  bool xauto_access);
117 
118 
119  // NEW HANDLE, EXISTING STATE CONSTRUCTORS
120 
126 
131  namespace_poset_member(const namespace_poset* xhost, const scoped_index& xid);
132 
137  namespace_poset_member(const namespace_poset* xhost, const std::string& xname);
138 
143  namespace_poset_member(const poset_state_handle& xmember_poset);
144 
149  poset_state_handle* poset_pointer() const;
150 
155  poset_type poset_type_id() const;
156 
161  const char* poset_class() const;
162 
167  pod_index_type poset_prereq_id(int xi) const;
168 
172  bool poset_is_external() const;
173 
174 protected:
175 
182  explicit namespace_poset_member(namespace_poset* xhost,
183  namespace_poset_dof_map* xdof_map = 0,
184  bool xcopy_dof_map = false,
185  bool xauto_access = true);
186 
191  void put_poset_pointer(const poset_state_handle* xposet);
192 
197  void put_poset_type_id(poset_type xtype_id);
198 
203  void put_poset_class(const char* xclass);
204 
208  void put_poset_prereq_id(int xi, pod_index_type xid);
209 
214  void put_poset(const poset_state_handle& xposet);
215 
216 private:
217 
219 
220 
221  // ===========================================================
223  // ===========================================================
225 
226 public:
227 
231  virtual namespace_poset_dof_map& dof_map(bool xrequire_write_access = false);
232 
236  virtual const namespace_poset_dof_map& dof_map(bool xrequire_write_access = false) const;
237 
242  virtual bool dof_map_is_ancestor_of(const poset_dof_map* xdof_map) const;
243 
244 protected:
245 
246 private:
247 
249 
250 
251  // ===========================================================
253  // ===========================================================
255 
256 public:
257 
262  {
264  };
265 
270  {
272  };
273 
274 protected:
275 
276 private:
277 
279 
280 
281  // ===========================================================
283  // ===========================================================
285 
286 public:
287 
293  {
294  return static_cast<namespace_poset_member*>(abstract_poset_member::p_join(other));
295  };
296 
302  {
303  return static_cast<namespace_poset_member*>(abstract_poset_member::p_meet(other));
304  };
305 
306 protected:
307 
308 private:
309 
311 
312 
313  // ===========================================================
315  // ===========================================================
317 
318 public:
319 
325  inline namespace_poset_member* l_join(abstract_poset_member* other, bool xnew_jem = true)
326  {
327  return static_cast<namespace_poset_member*>(abstract_poset_member::l_join(other, xnew_jem));
328  };
329 
335  inline namespace_poset_member* l_meet(abstract_poset_member* other, bool xnew_jem = true)
336  {
337  return static_cast<namespace_poset_member*>(abstract_poset_member::l_meet(other, xnew_jem));
338  };
339 
345  inline namespace_poset_member* l_not(bool xnew_jem = true) const
346  {
347  return static_cast<namespace_poset_member*>(abstract_poset_member::l_not(xnew_jem));
348  };
349 
350 protected:
351 
352 private:
353 
355 
356 
357  // ===========================================================
359  // ===========================================================
361 
362 public:
363 
367  namespace_poset* host() const;
368 
372  virtual bool host_is_ancestor_of(const poset_state_handle* xther) const;
373 
374 protected:
375 
376 private:
377 
379 
380 
381  // ===========================================================
383  // ===========================================================
385 
386 public:
387 
391  virtual bool is_ancestor_of(const any* other) const;
392 
396  virtual namespace_poset_member* clone() const;
397 
401  virtual bool invariant() const;
402 
403 protected:
404 
405 private:
406 
408 };
409 
410 } // namespace sheaf
411 
412 #endif // NAMESPACE_POSET_MEMBER_H
SHEAF_DLL_SPEC poset_type poset_type_id(int xi)
The poset type associated with int xi; converts int to poset type.
Definition: poset_type.cc:32
virtual total_poset_member * clone() const
Make a new handle, no state instance of current.
abstract_poset_member * p_join(abstract_poset_member *other) const
poset join of this with other, auto-allocated the poset join is the least upper bound in the poset ...
abstract_poset_member * greatest_jem() const
The largest member which is join-equivalent to this.
The default name space; a poset which contains other posets as members.
namespace_poset_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-, pre-, and self-allocated versions the poset meet is the greates...
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
A three state "bool". Does not provide the operations of ternary logic and is intended for use mostly...
Definition: tern.h:45
A client handle for a general, abstract partially order set.
namespace_poset_member * greatest_jem() const
The largest member which is join-equivalent to this.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
A client handle for a member of a namespace poset.
Abstract base class with useful features for all objects.
Definition: any.h:39
namespace_poset_member * p_join(abstract_poset_member *other) const
poset join of this with other, auto-, pre-, and self-allocated versions the poset join is the least u...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
abstract_poset_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-allocated The lattice pseudo-complement is the largest latt...
abstract_poset_member * least_jem() const
The smallest member which is join-equivalent to this.
namespace_poset_member * least_jem() const
The smallest member which is join-equivalent to this.
namespace_poset_member * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-, pre-, and self-allocated versions the lattice join is the lea...
namespace_poset_member * l_not(bool xnew_jem=true) const
lattice pseudo-complement of this, auto-, pre- and self allocated versions The lattice pseudo-complem...
abstract_poset_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-allocated the lattice meet is the greatest lower bound in the...
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.
A map from schema poset member ids to dof values for namespace_poset members.
An abstract client handle for a member of a poset.
abstract_poset_member * p_meet(abstract_poset_member *other)
poset meet of this with other, auto-allocated the poset meet is the greatest lower bound in the pos...
namespace_poset_member * l_meet(abstract_poset_member *other, bool xnew_jem=true)
lattice meet of this with other, auto-, pre-, and self-allocated versions the lattice meet is the gre...
A client handle for an unrestricted member of a poset. A total_poset_member is guaranteed not to be r...
abstract_poset_member * l_join(abstract_poset_member *other, bool xnew_jem=true)
lattice join of this with other, auto-allocated the lattice join is the least upper bound in the la...
namespace_poset_member * clone(bool xnew_state, bool xauto_access=true) const
Make a new handle instance of current. Attach the new instance to a new state if xnew_state is true...