SheafSystem  0.0.0.0
singleton_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 SINGLETON_INDEX_SPACE_INTERVAL_H
22 #define SINGLETON_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 namespace sheaf
45 {
46 
47 class singleton_implicit_index_space_iterator;
48 class index_space_handle;
49 
56 {
57 
58  friend class namespace_poset;
59  friend SHEAF_DLL_SPEC size_t deep_size(const singleton_index_space_interval& xn, bool xinclude_shallow);
60 
61  // ===========================================================
63  // ===========================================================
65 
66 public:
67 
74  static const singleton_index_space_interval& new_space(index_space_family& xid_spaces,
75  size_type xub,
76  pod_type xhub_offset);
77 
78 protected:
79 
80 private:
81 
83 
84 
85  // ===========================================================
87  // ===========================================================
89 
90 public:
91 
96 
100  pod_type hub_offset() const;
101 
102 protected:
103 
108 
113 
117  pod_type _hub_offset;
118 
119 private:
120 
122 
123 
124  // ===========================================================
126  // ===========================================================
128 
129 public:
130 
131 protected:
132 
133 private:
134 
136 
137 
138  // ===========================================================
140  // ===========================================================
142 
143 public:
144 
148  virtual const std::string& class_name() const;
149 
153  virtual singleton_index_space_interval* clone() const;
154 
155 protected:
156 
157 private:
158 
162  static bool make_prototype();
163 
165 
166 
167  // ===========================================================
169  // ===========================================================
171 
172 public:
173 
177  virtual bool operator==(const index_space_collection& xother) const;
178 
182  virtual size_type deep_size(bool xinclude_shallow) const;
183 
184 protected:
185 
189  virtual singleton_index_space_interval& operator=(const index_space_collection& xother);
190 
195  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const;
196 
197 private:
198 
200 
201 
202  // ===========================================================
204  // ===========================================================
206 
207 public:
208 
212  virtual void remove(pod_type xlocal_id);
213 
217  virtual size_type ct(pod_type xlocal_id) const;
218 
220 
224  virtual pod_type begin(pod_type xlocal_id) const;
225 
227 
231  virtual pod_type end(pod_type xlocal_id) const;
232 
233 
235 
239  virtual bool contains(pod_type xlocal_id, pod_type xid) const;
240 
245  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const;
246 
251  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const;
252 
257  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const;
258 
263  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const;
264 
268  virtual bool is_persistent(pod_type xlocal_id) const;
269 
270 protected:
271 
272 private:
273 
275 
276 
277  // ===========================================================
279  // ===========================================================
281 
282 public:
283 
288  virtual void new_product_structure(pod_type xlocal_id,
289  const abstract_product_structure& xproduct);
290 
294  virtual void delete_product_structure(pod_type xlocal_id);
295 
299  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const;
300 
304  virtual abstract_product_structure& product_structure(pod_type xlocal_id);
305 
309  virtual bool has_product_structure(pod_type xlocal_id) const;
310 
311 protected:
312 
313 private:
314 
316 
317 
318  // ===========================================================
320  // ===========================================================
322 
323 public:
324 
329  virtual index_space_handle& get_id_space(pod_type xlocal_id) const;
330 
334  virtual void release_id_space(index_space_handle& xid_space) const;
335 
340  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
341 
342 protected:
343 
348 
349 private:
350 
352 
353 
354  // ===========================================================
356  // ===========================================================
358 
359 public:
360 
365  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const;
366 
370  virtual void release_id_space_iterator(index_space_iterator& xitr) const;
371 
376  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const;
377 
378 protected:
379 
384 
385 private:
386 
388 
389 
390  // ===========================================================
392  // ===========================================================
394 
395 public:
396 
400  virtual bool is_ancestor_of(const any *other) const;
401 
405  virtual bool invariant() const;
406 
407 protected:
408 
409 private:
410 
412 
413 };
414 
415 // ===========================================================
416 // NON-MEMBER FUNCTIONS
417 // ===========================================================
418 
422 SHEAF_DLL_SPEC
423 size_t deep_size(const singleton_index_space_interval& xn, bool xinclude_shallow = true);
424 
425 } // end namespace sheaf
426 
427 #endif // ifndef SINGLETON_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.
An implementation of index_space_interval for an interval of implicit id spaces with a single id and ...
The default name space; a poset which contains other posets as members.
singleton_index_space_interval(const singleton_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< singleton_implicit_index_space_iterator > _iterators
The iterator pool.
list_pool< forwarding_index_space_handle > _handles
The handle 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()...
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