SheafSystem  0.0.0.0
array_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 ARRAY_INDEX_SPACE_INTERVAL_H
22 #define ARRAY_INDEX_SPACE_INTERVAL_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef FORWARDING_INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/forwarding_index_space_handle.h"
30 #endif
31 
32 #ifndef INDEX_SPACE_INTERVAL_H
33 #include "SheafSystem/index_space_interval.h"
34 #endif
35 
36 #ifndef BLOCK_H
37 #include "SheafSystem/block.h"
38 #endif
39 
40 #ifndef LIST_POOL_H
41 #include "SheafSystem/list_pool.h"
42 #endif
43 
44 #ifndef STD_UNORDERED_MAP_H
45 #include "SheafSystem/std_unordered_map.h"
46 #endif
47 
48 namespace sheaf
49 {
50 
51 class array_implicit_index_space_iterator;
52 class index_space_handle;
53 
58 class SHEAF_DLL_SPEC array_index_space_interval : public index_space_interval
59 {
60 
61  friend class namespace_poset;
62  friend SHEAF_DLL_SPEC size_t deep_size(const array_index_space_interval& xn, bool xinclude_shallow);
63 
64  // ===========================================================
66  // ===========================================================
68 
69 public:
70 
78  static const array_index_space_interval& new_space(index_space_family& xid_spaces,
79  size_type xub,
80  block<pod_type>& xhub_ids,
81  size_type xids_per_space,
82  bool xowns_hub_ids);
83 
84 protected:
85 
86 private:
87 
89 
90 
91  // ===========================================================
93  // ===========================================================
95 
96 public:
97 
101  virtual ~array_index_space_interval();
102 
106  const block<pod_type>& hub_ids() const;
107 
111  size_type ids_per_space() const;
112 
118  bool owns_hub_ids() const;
119 
120 protected:
121 
125 
130 
134  block<pod_type>* _hub_ids;
135 
140 
146 
147 private:
148 
150 
151 
152  // ===========================================================
154  // ===========================================================
156 
157 public:
158 
159 protected:
160 
161 private:
162 
164 
165 
166  // ===========================================================
168  // ===========================================================
170 
171 public:
172 
176  virtual const std::string& class_name() const;
177 
181  virtual array_index_space_interval* clone() const;
182 
183 protected:
184 
185 private:
186 
190  static bool make_prototype();
191 
193 
194 
195  // ===========================================================
197  // ===========================================================
199 
200 public:
201 
205  virtual bool operator==(const index_space_collection& xother) const;
206 
210  virtual size_type deep_size(bool xinclude_shallow) const;
211 
212 protected:
213 
217  virtual array_index_space_interval& operator=(const index_space_collection& xother);
218 
223  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const;
224 
225 private:
226 
228 
229 
230  // ===========================================================
232  // ===========================================================
234 
235 public:
236 
240  virtual void remove(pod_type xlocal_id);
241 
245  virtual size_type ct(pod_type xlocal_id) const;
246 
248 
252  virtual pod_type begin(pod_type xlocal_id) const;
253 
255 
259  virtual pod_type end(pod_type xlocal_id) const;
260 
262 
266  virtual bool contains(pod_type xlocal_id, pod_type xid) const;
267 
272  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const;
273 
278  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const;
279 
284  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const;
285 
290  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const;
291 
295  virtual bool is_persistent(pod_type xlocal_id) const;
296 
297 protected:
298 
299 private:
300 
302 
303 
304  // ===========================================================
306  // ===========================================================
308 
309 public:
310 
315  virtual void new_product_structure(pod_type xlocal_id,
316  const abstract_product_structure& xproduct);
317 
321  virtual void delete_product_structure(pod_type xlocal_id);
322 
326  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const;
327 
331  virtual abstract_product_structure& product_structure(pod_type xlocal_id);
332 
336  virtual bool has_product_structure(pod_type xlocal_id) const;
337 
338 protected:
339 
340 private:
341 
343 
344 
345  // ===========================================================
347  // ===========================================================
349 
350 public:
351 
356  virtual index_space_handle& get_id_space(pod_type xlocal_id) const;
357 
361  virtual void release_id_space(index_space_handle& xid_space) const;
362 
367  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
368 
369 protected:
370 
375 
376 private:
377 
379 
380 
381  // ===========================================================
383  // ===========================================================
385 
386 public:
387 
392  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const;
393 
397  virtual void release_id_space_iterator(index_space_iterator& xitr) const;
398 
403  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const;
404 
405 protected:
406 
411 
412 private:
413 
415 
416 
417  // ===========================================================
419  // ===========================================================
421 
422 public:
423 
427  virtual bool is_ancestor_of(const any *other) const;
428 
432  virtual bool invariant() const;
433 
434 protected:
435 
436 private:
437 
439 
440 };
441 
442 // ===========================================================
443 // NON-MEMBER FUNCTIONS
444 // ===========================================================
445 
449 SHEAF_DLL_SPEC
450 size_t deep_size(const array_index_space_interval& xn, bool xinclude_shallow = true);
451 
452 } // end namespace sheaf
453 
454 #endif // ifndef ARRAY_INDEX_SPACE_INTERVAL_H
size_type _ids_per_space
The number of ids per id space.
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.
bool _owns_hub_ids
True if this interval is responsible for the memory management of _hub_ids.
array_index_space_interval(const array_index_space_interval &xother)
Copy constructor; disabled.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
list_pool< array_implicit_index_space_iterator > _iterators
The iterator pool.
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()...
list_pool< forwarding_index_space_handle > _handles
The handle pool.
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...
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.
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.
A reallocated pool of objects of type T. Objects in the pool are either allocated or stored in a free...
Definition: list_pool.h:42
An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids ...