SheafSystem  0.0.0.0
refinable_poset.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 REFINABLE_POSET_H
22 #define REFINABLE_POSET_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POSET_H
29 #include "SheafSystem/poset.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class namespace_poset;
36 
41 class SHEAF_DLL_SPEC refinable_poset : public poset
42 {
43 
44  friend class abstract_poset_member;
45  friend class block_poset_builder;
46  friend class namespace_poset;
47  friend class poset_component;
48  friend class poset_orderer;
49  friend class poset_traverser;
50  friend class storage_agent;
51 
52  // ===========================================================
54  // ===========================================================
56 
57 public:
58 
63  static refinable_poset& new_table(namespace_type& xhost,
64  const poset_path& xpath,
65  const poset_path& xschema_path,
66  bool xauto_access);
67 
71  void put_version(int xversion);
72 
76  subposet& coarsest_common_refinement();
77 
81  const subposet& coarsest_common_refinement() const;
82 
86  subposet& coarsest_common_refinement_jims();
87 
91  const subposet& coarsest_common_refinement_jims() const;
92 
96  virtual void begin_refine_mode(bool xauto_access = true);
97 
102  virtual void end_refine_mode(bool xensure_lattice_invariant = true,
103  bool xauto_access = true);
104 
105 protected:
106 
110  refinable_poset();
111 
115  virtual ~refinable_poset();
116 
120  refinable_poset(const refinable_poset& xother) { };
121 
126  {
127  return const_cast<refinable_poset&>(*this);
128  };
129 
130 private:
131 
135  void new_version(int xversion);
136 
138 
139 
140  // ===========================================================
142  // ===========================================================
144 
145 public:
146 
147 protected:
148 
149 private:
150 
154  static bool make_prototype();
155 
157 
158 
159  // ===========================================================
161  // ===========================================================
163 
164 public:
165 
169  virtual poset_type type_id() const;
170 
174  virtual const char* class_name() const;
175 
176  // Need to redefine the protected new_member.
177  // Need to put using declaration here as opposed to with
178  // redeclaration so it won't make the inherited public
179  // new_member functions protected.
180 
185 
186  // using poset::new_member;
187 
196  virtual pod_index_type new_member(bool xis_jim, pod_index_type xdof_tuple_id);
197 
206  void new_member(bool xis_jim, const scoped_index& xdof_tuple_id, scoped_index& result)
207  {
208  poset::new_member(xis_jim, xdof_tuple_id, result);
209  }
210 
220  pod_index_type new_member(bool xis_jim, poset_dof_map* xdof_map = 0, bool xcopy_dof_map = false)
221  {
222  return poset::new_member(xis_jim, xdof_map, xcopy_dof_map);
223  };
224 
234  void new_member(bool xis_jim, poset_dof_map* xdof_map,
235  bool xcopy_dof_map, scoped_index& result)
236  {
237  poset::new_member(xis_jim, xdof_map, xcopy_dof_map, result);
238  }
239 
240  // Need to redefine the protected new_member_interval.
241  // Need to put using declaration here as opposed to with
242  // redeclaration so it won't make the inherited public
243  // new_member_interval functions protected.
244 
249 
250  // using poset::new_member_interval;
251 
260  virtual pod_index_type new_member_interval(const std::string& xinterval_type,
261  size_type xsize,
262  const block<pod_index_type>& xdof_tuple_ids,
263  const block<pod_index_type>& xdata)
264  {
265  return poset::new_member_interval(xinterval_type, xsize, xdof_tuple_ids, xdata);
266  };
267 
276  void new_member_interval(const std::string& xinterval_type, size_type xsize,
277  const block<pod_index_type>& xdof_tuple_ids,
278  const block<pod_index_type>& xdata,
279  scoped_index& result)
280  {
281  poset::new_member_interval(xinterval_type, xsize, xdof_tuple_ids, xdata, result);
282  }
283 
284 protected:
285 
286  // see description of using declaration hack above.
287 
296  virtual void new_member(const scoped_index& xindex,
297  bool xis_jim,
298  const scoped_index& xdof_tuple_id);
299 
309  void new_member(const scoped_index& xindex,
310  bool xis_jim,
311  poset_dof_map* xdof_map = 0,
312  bool xcopy_dof_map = false)
313  {
314  poset::new_member(xindex.hub_pod(), xis_jim, xdof_map, xcopy_dof_map);
315  };
316 
317  // Using declaration for new_member_interval in public scope above.
318 
331  virtual pod_index_type new_member_interval(const std::string& xinterval_type, size_type xsize);
332 
346  virtual void new_member_interval(const scoped_index& xindex,
347  const std::string& xinterval_type,
348  size_type xsize);
349 
350 private:
351 
353 
354 
355  // ===========================================================
357  // ===========================================================
359 
360 public:
361 
365  virtual bool is_ancestor_of(const any* other) const;
366 
371  virtual refinable_poset* clone() const;
372 
376  virtual bool invariant() const;
377 
378 protected:
379 
380 private:
381 
383 };
384 
385 } // namespace sheaf
386 
387 #endif // REFINABLE_POSET_H
A client handle for a subposet.
Definition: subposet.h:86
The default name space; a poset which contains other posets as members.
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
A client handle for a general, abstract partially order set.
Abstract traverser (internal iterator) for poset.
A path defined by a poset name and a member name separated by a forward slash (&#39;/&#39;). For example: "cell_definitions/triangle".
Definition: poset_path.h:48
void new_member(const scoped_index &xindex, bool xis_jim, poset_dof_map *xdof_map=0, bool xcopy_dof_map=false)
Create a disconnected member with index xindex and is_jim == xis_jim. If xdof_map != 0...
Features shared by poset_member and subposet. Subposet and poset_member objects can be attached...
refinable_poset & operator=(const poset_state_handle &xother)
Assignment operator; disabled.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
virtual pod_index_type new_member(bool xis_jim, pod_index_type xtuple_hub_id)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by hub id xtuple_hub...
Abstract base class with useful features for all objects.
Definition: any.h:39
A client handle for a mutable partially ordered set.
Definition: poset.h:40
A client handle for a partially order set that can be refined, that is, a jim can be converted to a j...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
void new_member(bool xis_jim, poset_dof_map *xdof_map, bool xcopy_dof_map, scoped_index &result)
Create a disconnected member with is_jim == xis_jim. If xdof_map != 0, the new member uses it for dof...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
void new_member(bool xis_jim, const scoped_index &xdof_tuple_id, scoped_index &result)
Create a disconnected member with is_jim == xis_jim and the dof tuple identified by xdof_tuple_id...
virtual pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xdof_tuple_ids, const block< pod_index_type > &xdata)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xdof_tupl...
Namespace for the sheaves component of the sheaf system.
virtual pod_index_type new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xtuple_hub_ids, const block< pod_index_type > &xdata)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xtuple_hu...
An abstract client handle for a member of a poset.
void new_member_interval(const std::string &xinterval_type, size_type xsize, const block< pod_index_type > &xdof_tuple_ids, const block< pod_index_type > &xdata, scoped_index &result)
Create a disconnected member interval of type xinterval_type with size xsize, dof tuple ids xdof_tupl...
Traverser to ensure validity of order relation.
Definition: poset_orderer.h:46
pod_index_type new_member(bool xis_jim, poset_dof_map *xdof_map=0, bool xcopy_dof_map=false)
Create a disconnected member with is_jim == xis_jim. If xdof_map != 0, the new member uses it for dof...
refinable_poset(const refinable_poset &xother)
Copy constructor; disabled.
Agent responsible for importing and exporting posets from an external name space which resides on dis...
Definition: storage_agent.h:74
pod_type hub_pod() const
The pod value of this mapped to the unglued hub id space.
Definition: scoped_index.h:710