SheafSystem  0.0.0.0
explicit_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 EXPLICIT_INDEX_SPACE_COLLECTION_H
22 #define EXPLICIT_INDEX_SPACE_COLLECTION_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef INDEX_SPACE_COLLECTION_H
29 #include "SheafSystem/index_space_collection.h"
30 #endif
31 
32 #ifndef STD_UNORDERED_MAP_H
33 #include "SheafSystem/std_unordered_map.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 //class arg_list;
40 
46 {
47  friend class index_space_family;
48 
49  // ===========================================================
51  // ===========================================================
53 
54 public:
55 
59  //static arg_list make_arg_list(pod_type xcapacity);
60 
65 
69  size_type capacity() const;
70 
74  void insert(explicit_index_space_state& xid_space);
75 
76 protected:
77 
82 
87 
91  typedef unordered::unordered_map<pod_type, explicit_index_space_state*> map_type;
92 
96  map_type _states;
97 
98 private:
99 
101 
102 
103  // ===========================================================
105  // ===========================================================
107 
108 public:
109 
113  virtual bool operator==(const index_space_collection& xother) const;
114 
118  virtual bool contains(pod_type xlocal_id) const;
119 
123  virtual bool contains_family(pod_type xspace_id) const;
124 
128  virtual pod_type local_scope(pod_type xspace_id) const;
129 
133  virtual pod_type family_scope(pod_type xlocal_id) const;
134 
135 protected:
136 
140  virtual explicit_index_space_collection& operator=(const index_space_collection& xother);
141 
146  virtual explicit_index_space_state* explicit_state(pod_type xlocal_id) const;
147 
148 private:
149 
151 
152 
153  // ===========================================================
155  // ===========================================================
157 
158 public:
159 
163  virtual const index_space_family& id_spaces() const;
164 
168  virtual index_space_family& id_spaces();
169 
173  virtual void remove(pod_type xlocal_id);
174 
178  virtual size_type ct(pod_type xlocal_id) const;
179 
183  virtual pod_type begin(pod_type xlocal_id) const;
184 
188  virtual pod_type end(pod_type xlocal_id) const;
189 
193  virtual bool contains(pod_type xlocal_id, pod_type xid) const;
194 
199  virtual bool contains_unglued_hub(pod_type xlocal_id, pod_type xid) const;
200 
205  virtual bool contains(pod_type xlocal_id, pod_type xid, pod_type xhub_id) const;
206 
211  virtual pod_type pod(pod_type xlocal_id, pod_type xid) const;
212 
217  virtual pod_type unglued_hub_pod(pod_type xlocal_id, pod_type xid) const;
218 
222  virtual bool is_persistent(pod_type xlocal_id) const;
223 
224 protected:
225 
230 
231 private:
232 
234 
235 
236  // ===========================================================
238  // ===========================================================
240 
241 public:
242 
247  virtual void new_product_structure(pod_type xlocal_id,
248  const abstract_product_structure& xproduct);
249 
253  virtual void delete_product_structure(pod_type xlocal_id);
254 
258  virtual const abstract_product_structure& product_structure(pod_type xlocal_id) const;
259 
263  virtual abstract_product_structure& product_structure(pod_type xlocal_id);
264 
268  virtual bool has_product_structure(pod_type xlocal_id) const;
269 
270 protected:
271 
272 private:
273 
275 
276 
277  // ===========================================================
279  // ===========================================================
281 
282 public:
283 
288  virtual index_space_handle& get_id_space(pod_type xlocal_id) const;
289 
293  virtual void release_id_space(index_space_handle& xid_space) const;
294 
299  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
300 
301 protected:
302 
303 private:
304 
306 
307 
308  // ===========================================================
310  // ===========================================================
312 
313 public:
314 
319  virtual index_space_iterator& get_id_space_iterator(pod_type xlocal_id) const;
320 
324  virtual void release_id_space_iterator(index_space_iterator& xitr) const;
325 
330  virtual bool allocated_id_space_iterator(const index_space_iterator& xitr) const;
331 
332 protected:
333 
334 private:
335 
337 
338 
339  // ===========================================================
341  // ===========================================================
343 
344 public:
345 
349  virtual bool is_ancestor_of(const any *other) const;
350 
354  virtual bool invariant() const;
355 
356 protected:
357 
358 private:
359 
361 
362 };
363 
364 // ===========================================================
365 // NON-MEMBER FUNCTIONS
366 // ===========================================================
367 
371 SHEAF_DLL_SPEC
372 size_t deep_size(const explicit_index_space_collection& xn, bool xinclude_shallow = true);
373 
374 } // end namespace sheaf
375 
376 #endif // ifndef EXPLICIT_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.
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
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.
unordered::unordered_map< pod_type, explicit_index_space_state * > map_type
The type of explicit id space map.
map_type _states
The map from space id to explicit id space.
Namespace for the sheaves component of the sheaf system.
An implementation of index_space_collection for a sparse collection of explicit id spaces...
Factory and container for a family of id spaces.
index_space_family * _id_spaces
The index space family of this collection.