SheafSystem  0.0.0.0
ragged_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 RAGGED_ARRAY_INDEX_SPACE_INTERVAL_H
22 #define RAGGED_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 LIST_POOL_H
37 #include "SheafSystem/list_pool.h"
38 #endif
39 
40 #ifndef STD_UNORDERED_MAP_H
41 #include "SheafSystem/std_unordered_map.h"
42 #endif
43 
44 #ifndef RAGGED_ARRAY_H
45 #include "SheafSystem/ragged_array.h"
46 #endif
47 
48 namespace sheaf
49 {
50 
51 class ragged_array_implicit_index_space_iterator;
52 class index_space_handle;
53 
60 {
61 
62  friend class namespace_poset;
63  friend SHEAF_DLL_SPEC size_t deep_size(const ragged_array_index_space_interval& xn, bool xinclude_shallow);
64 
65  // ===========================================================
67  // ===========================================================
69 
70 public:
71 
78  static const ragged_array_index_space_interval& new_space(index_space_family& xid_spaces,
79  size_type xub,
80  ragged_array<pod_type>& xhub_ids,
81  bool xowns_hub_ids);
82 
83 protected:
84 
85 private:
86 
88 
89 
90  // ===========================================================
92  // ===========================================================
94 
95 public:
96 
101 
105  const ragged_array<pod_type>& hub_ids() const;
106 
112  bool owns_hub_ids() const;
113 
114 protected:
115 
119 
124 
128  ragged_array<pod_type>* _hub_ids;
129 
135 
136 private:
137 
139 
140 
141  // ===========================================================
143  // ===========================================================
145 
146 public:
147 
148 protected:
149 
150 private:
151 
153 
154 
155  // ===========================================================
157  // ===========================================================
159 
160 public:
161 
165  virtual const std::string& class_name() const;
166 
170  virtual ragged_array_index_space_interval* clone() const;
171 
172 protected:
173 
174 private:
175 
179  static bool make_prototype();
180 
182 
183 
184  // ===========================================================
186  // ===========================================================
188 
189 public:
190 
194  virtual bool operator==(const index_space_collection& xother) const;
195 
199  virtual size_type deep_size(bool xinclude_shallow) const;
200 
201 protected:
202 
206  virtual ragged_array_index_space_interval& operator=(const index_space_collection& xother);
207 
212  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const;
213 
214 private:
215 
217 
218 
219  // ===========================================================
221  // ===========================================================
223 
224 public:
225 
229  virtual void remove(pod_type xlocal_id);
230 
234  virtual size_type ct(pod_type xlocal_id) const;
235 
237 
241  virtual pod_type begin(pod_type xlocal_id) const;
242 
244 
248  virtual pod_type end(pod_type xlocal_id) const;
249 
250 
252 
256  virtual bool contains(pod_type xlocal_id, pod_type xid) const;
257 
262  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const;
263 
268  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const;
269 
274  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const;
275 
280  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const;
281 
285  virtual bool is_persistent(pod_type xlocal_id) const;
286 
287 protected:
288 
289 private:
290 
292 
293 
294  // ===========================================================
296  // ===========================================================
298 
299 public:
300 
305  virtual void new_product_structure(pod_type xlocal_id,
306  const abstract_product_structure& xproduct);
307 
311  virtual void delete_product_structure(pod_type xlocal_id);
312 
316  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const;
317 
321  virtual abstract_product_structure& product_structure(pod_type xlocal_id);
322 
326  virtual bool has_product_structure(pod_type xlocal_id) const;
327 
328 protected:
329 
330 private:
331 
333 
334 
335  // ===========================================================
337  // ===========================================================
339 
340 public:
341 
346  virtual index_space_handle& get_id_space(pod_type xlocal_id) const;
347 
351  virtual void release_id_space(index_space_handle& xid_space) const;
352 
357  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
358 
359 protected:
360 
365 
366 private:
367 
369 
370 
371  // ===========================================================
373  // ===========================================================
375 
376 public:
377 
382  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const;
383 
387  virtual void release_id_space_iterator(index_space_iterator& xitr) const;
388 
393  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const;
394 
395 protected:
396 
401 
402 private:
403 
405 
406 
407  // ===========================================================
409  // ===========================================================
411 
412 public:
413 
417  virtual bool is_ancestor_of(const any *other) const;
418 
422  virtual bool invariant() const;
423 
424 protected:
425 
426 private:
427 
429 
430 };
431 
432 // ===========================================================
433 // NON-MEMBER FUNCTIONS
434 // ===========================================================
435 
439 SHEAF_DLL_SPEC
440 size_t deep_size(const ragged_array_index_space_interval& xn, bool xinclude_shallow = true);
441 
442 } // end namespace sheaf
443 
444 #endif // ifndef RAGGED_ARRAY_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...
Abstract base class with useful features for all objects.
Definition: any.h:39
bool _owns_hub_ids
True if this interval is responsible for the memory management of _hub_ids.
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...
list_pool< ragged_array_implicit_index_space_iterator > _iterators
The iterator pool.
An implementation of index_space_interval for an interval of implicit id spaces in which the hub ids ...
list_pool< forwarding_index_space_handle > _handles
The handle pool.
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.
ragged_array_index_space_interval(const ragged_array_index_space_interval &xother)
Copy constructor; disabled.
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