SheafSystem  0.0.0.0
index_space_collection.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 INDEX_SPACE_COLLECTION_H
22 #define INDEX_SPACE_COLLECTION_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef POD_TYPES_H
33 #include "SheafSystem/pod_types.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class abstract_product_structure;
40 class explicit_index_space_state;
41 class hub_index_space_handle;
42 class index_space_family;
43 class index_space_handle;
44 class index_space_iterator;
45 class scoped_index;
46 
52 class SHEAF_DLL_SPEC index_space_collection : public any
53 {
54 
55  friend class explicit_index_space_handle;
56  friend class explicit_index_space_iterator;
57  friend class index_space_family;
58 
59  // ===========================================================
61  // ===========================================================
63 
64 public:
65 
70 
74  virtual ~index_space_collection();
75 
79  virtual bool operator==(const index_space_collection& xother) const = 0;
80 
84  virtual bool contains(pod_type xlocal_id) const = 0;
85 
89  virtual bool contains_family(pod_type xspace_id) const = 0;
90 
94  virtual pod_type local_scope(pod_type xspace_id) const = 0;
95 
99  virtual pod_type family_scope(pod_type xlocal_id) const = 0;
100 
104  virtual size_type deep_size(bool xinclude_shallow) const = 0;
105 
106 protected:
107 
112 
117 
121  virtual index_space_collection& operator=(const index_space_collection& xother) = 0;
122 
127  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const = 0;
128 
129 private:
130 
132 
133 
134  // ===========================================================
136  // ===========================================================
138 
139 public:
140 
144  virtual const index_space_family& id_spaces() const = 0;
145 
149  virtual index_space_family& id_spaces() = 0;
150 
154  const hub_index_space_handle& hub_id_space() const;
155 
159  virtual void remove(pod_type xlocal_id) = 0;
160 
164  virtual size_type ct(pod_type xlocal_id) const = 0;
165 
169  bool is_empty(pod_type xlocal_id) const;
170 
174  virtual pod_type begin(pod_type xlocal_id) const = 0;
175 
179  virtual pod_type end(pod_type xlocal_id) const = 0;
180 
184  bool is_gathered(pod_type xlocal_id) const;
185 
189  virtual bool contains(pod_type xlocal_id, pod_type xid) const = 0;
190 
195  bool contains(pod_type xlocal_id, const scoped_index& xid) const;
196 
202  bool contains_hub(pod_type xlocal_id, pod_type xid) const;
203 
208  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const = 0;
209 
214  bool contains_glued_hub(pod_type xlocal_id, pod_type xid) const;
215 
221  bool contains(pod_type xlocal_id, pod_type xid, const scoped_index& xhub_id) const;
222 
227  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const = 0;
228 
233  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const = 0;
234 
239  pod_type pod(pod_type xlocal_id, const scoped_index& xid) const;
240 
246  pod_type hub_pod(pod_type xlocal_id, pod_type xid) const;
247 
252  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const = 0;
253 
258  pod_type glued_hub_pod(pod_type xlocal_id, pod_type xid) const;
259 
263  virtual bool is_persistent(pod_type xlocal_id) const = 0;
264 
265 protected:
266 
267 private:
268 
270 
271 
272  // ===========================================================
274  // ===========================================================
276 
277 public:
278 
283  virtual void new_product_structure(pod_type xlocal_id,
284  const abstract_product_structure& xproduct) = 0;
285 
289  virtual void delete_product_structure(pod_type xlocal_id) = 0;
290 
294  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const = 0;
295 
299  virtual abstract_product_structure& product_structure(pod_type xlocal_id) = 0;
300 
304  virtual bool has_product_structure(pod_type xlocal_id) const = 0;
305 
306 protected:
307 
308 private:
309 
311 
312 
313  // ===========================================================
315  // ===========================================================
317 
318 public:
319 
324  virtual index_space_handle& get_id_space(pod_type xlocal_id) const = 0;
325 
329  virtual void release_id_space(index_space_handle& xid_space) const = 0;
330 
335  virtual bool allocated_id_space(const index_space_handle& xid_space) const = 0;
336 
337 protected:
338 
339 private:
340 
342 
343 
344  // ===========================================================
346  // ===========================================================
348 
349 public:
350 
355  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const = 0;
356 
360  virtual void release_id_space_iterator(index_space_iterator& xitr) const = 0;
361 
366  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const = 0;
367 
368 protected:
369 
370 private:
371 
373 
374 
375  // ===========================================================
377  // ===========================================================
379 
380 public:
381 
385  virtual bool is_ancestor_of(const any *other) const;
386 
390  virtual bool invariant() const;
391 
393 
394 };
395 
396 // ===========================================================
397 // NON-MEMBER FUNCTIONS
398 // ===========================================================
399 
400 } // end namespace sheaf
401 
402 #endif // ifndef INDEX_SPACE_COLLECTION_H
An abstract class that defines the product structure for an id space.
An abstract iterator over the ids of an id space.
index_space_collection(const index_space_collection &xother)
Copy constructor; disabled.
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.
An implementation of class sum_index_space_handle that has a primary sum id space state...
Abstract base class with useful features for all objects.
Definition: any.h:39
An immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
An implementation of class index_space_handle for an explicit_index_space_state.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
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.
An implementation of class index_space_iterator for an explicit_index_space_state.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.