SheafSystem  0.0.0.0
explicit_index_space_interval.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 EXPLICIT_INDEX_SPACE_INTERVAL_H
22 #define EXPLICIT_INDEX_SPACE_INTERVAL_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef INDEX_SPACE_INTERVAL_H
29 #include "SheafSystem/index_space_interval.h"
30 #endif
31 
32 #ifndef AUTO_BLOCK_H
33 #include "SheafSystem/auto_block.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class index_space_handle;
40 
46 {
47 
48  friend class namespace_poset;
49  friend SHEAF_DLL_SPEC size_t deep_size(const explicit_index_space_interval& xn, bool xinclude_shallow);
50 
51  // ===========================================================
53  // ===========================================================
55 
56 public:
57 
63  static const explicit_index_space_interval& new_space(index_space_family& xid_spaces,
64  size_type xub);
65 
66 protected:
67 
68 private:
69 
71 
72 
73  // ===========================================================
75  // ===========================================================
77 
78 public:
79 
84 
88  void insert(explicit_index_space_state& xid_space);
89 
90 protected:
91 
97 
102 
107 
111  explicit_states_type _states;
112 
113 private:
114 
116 
117 
118  // ===========================================================
120  // ===========================================================
122 
123 public:
124 
125 protected:
126 
130  virtual bool supports_persistent_id_spaces() const;
131 
132 private:
133 
135 
136 
137  // ===========================================================
139  // ===========================================================
141 
142 public:
143 
147  virtual const std::string& class_name() const;
148 
152  virtual explicit_index_space_interval* clone() const;
153 
154 protected:
155 
156 private:
157 
161  static bool make_prototype();
162 
164 
165 
166  // ===========================================================
168  // ===========================================================
170 
171 public:
172 
176  virtual bool operator==(const index_space_collection& xother) const;
177 
181  virtual bool contains(pod_type xlocal_id) const;
182 
186  virtual bool contains_family(pod_type xspace_id) const;
187 
191  virtual size_type deep_size(bool xinclude_shallow) const;
192 
193 protected:
194 
198  virtual explicit_index_space_interval& operator=(const index_space_collection& xother);
199 
204  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const;
205 
206 private:
207 
209 
210 
211  // ===========================================================
213  // ===========================================================
215 
216 public:
217 
221  virtual void remove(pod_type xlocal_id);
222 
226  virtual size_type ct(pod_type xlocal_id) const;
227 
229 
233  virtual pod_type begin(pod_type xlocal_id) const;
234 
236 
240  virtual pod_type end(pod_type xlocal_id) const;
241 
243 
247  virtual bool contains(pod_type xlocal_id, pod_type xid) const;
248 
253  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const;
254 
259  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const;
260 
265  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const;
266 
271  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const;
272 
276  virtual bool is_persistent(pod_type xlocal_id) const;
277 
278 protected:
279 
280 private:
281 
283 
284 
285  // ===========================================================
287  // ===========================================================
289 
290 public:
291 
296  virtual void new_product_structure(pod_type xlocal_id,
297  const abstract_product_structure& xproduct);
298 
302  virtual void delete_product_structure(pod_type xlocal_id);
303 
307  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const;
308 
312  virtual abstract_product_structure& product_structure(pod_type xlocal_id);
313 
317  virtual bool has_product_structure(pod_type xlocal_id) const;
318 
319 protected:
320 
321 private:
322 
324 
325 
326  // ===========================================================
328  // ===========================================================
330 
331 public:
332 
337  virtual index_space_handle& get_id_space(pod_type xlocal_id) const;
338 
342  virtual void release_id_space(index_space_handle& xid_space) const;
343 
348  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
349 
350 protected:
351 
352 private:
353 
355 
356 
357  // ===========================================================
359  // ===========================================================
361 
362 public:
363 
368  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const;
369 
373  virtual void release_id_space_iterator(index_space_iterator& xitr) const;
374 
379  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const;
380 
381 protected:
382 
383 private:
384 
386 
387 
388  // ===========================================================
390  // ===========================================================
392 
393 public:
394 
398  virtual bool is_ancestor_of(const any *other) const;
399 
403  virtual bool invariant() const;
404 
405 protected:
406 
407 private:
408 
410 
411 };
412 
413 // ===========================================================
414 // NON-MEMBER FUNCTIONS
415 // ===========================================================
416 
420 SHEAF_DLL_SPEC
421 size_t deep_size(const explicit_index_space_interval& xn, bool xinclude_shallow = true);
422 
423 } // end namespace sheaf
424 
425 #endif // ifndef EXPLICIT_INDEX_SPACE_INTERVAL_H
An abstract class that defines the product structure for an id space.
An abstract iterator over the ids of an id space.
The default name space; a poset which contains other posets as members.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
pod_index_type pod_type
The "plain old data" index type for this.
A contiguously allocated array of items of type T with size information and automatic resizing...
Definition: auto_block.h:122
A auto_block initialization policy that initializes the values to zero.
Definition: auto_block.h:102
Abstract base class with useful features for all objects.
Definition: any.h:39
An implemenation of index_space_collection that adds an interface for the interval [begin()...
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
SHEAF_DLL_SPEC size_t deep_size(const dof_descriptor_array &xp, bool xinclude_shallow=true)
The deep size of the referenced object of type dof_descriptor_array.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A collection of id space states. This is a virtual class with provides an interface for accessing the...
explicit_index_space_interval(const explicit_index_space_interval &xother)
Copy constructor; disabled.
An implementation of index_space_interval for an interval of explicit id spaces.
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.
auto_block< explicit_index_space_state *, zero_block_initialization_policy< explicit_index_space_state * > > explicit_states_type
Type of the explicit state block.
Namespace for the sheaves component of the sheaf system.
pod_type end() const
Ending space id of this interval in the id space family scope.
virtual bool contains(pod_type xlocal_id) const
True if this collection contains the id space with local id xlocal_id.
Factory and container for a family of id spaces.
pod_type begin() const
Beginning space id of this interval in the id space family scope.