SheafSystem  0.0.0.0
primary_index_space_state.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 PRIMARY_INDEX_SPACE_STATE_H
22 #define PRIMARY_INDEX_SPACE_STATE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef LIST_POOL_H
29 #include "SheafSystem/list_pool.h"
30 #endif
31 
32 #ifndef EXPLICIT_INDEX_SPACE_STATE_H
33 #include "SheafSystem/explicit_index_space_state.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class primary_index_space_handle;
40 class primary_index_space_iterator;
41 
51 {
52  friend class namespace_poset;
53  friend class primary_index_space_handle;
54 
55  // ===========================================================
57  // ===========================================================
59 
60 public:
61 
68  static primary_index_space_handle new_space(index_space_family& xid_spaces,
69  const std::string& xname,
70  pod_type xoffset,
71  size_type xct);
72 
78  static primary_index_space_handle new_space(index_space_family& xid_spaces,
79  pod_type xid,
80  const std::string& xname,
81  pod_type xoffset,
82  size_type xct);
83 
84 protected:
85 
86 private:
87 
89 
90 
91  // ===========================================================
93  // ===========================================================
95 
96 public:
97 
98 protected:
99 
104 
109 
113  virtual ~primary_index_space_state();
114 
115 private:
116 
118 
119 
120  // ===========================================================
122  // ===========================================================
124 
125 public:
126 
130  pod_type offset() const;
131 
135  virtual void extend(size_type xct);
136 
140  pod_type hub_term_id() const;
141 
142 protected:
143 
147  void put_hub_term_id(pod_type xhub_term_id);
148 
152  pod_type _offset;
153 
157  pod_type _hub_term_id;
158 
159 private:
160 
162 
163 
164  // ===========================================================
166  // ===========================================================
168 
169 public:
170 
174  virtual bool operator==(const explicit_index_space_state& xother) const;
175 
179  virtual size_type deep_size(bool xinclude_shallow) const;
180 
181 protected:
182 
186  virtual primary_index_space_state& operator=(const explicit_index_space_state& xother);
187 
188 private:
189 
191 
192 
193  // ===========================================================
195  // ===========================================================
197 
198 public:
199 
203  virtual bool contains(pod_type xid) const;
204 
208  virtual bool contains_unglued_hub(pod_type xid) const;
209 
213  virtual pod_type pod(pod_type xid) const;
214 
218  virtual pod_type unglued_hub_pod(pod_type xid) const;
219 
221 // ///
222 // /// The pod index in the primary sum id space equivalent to xid in this id space.
223 // ///
224 // virtual pod_type primary_sum_pod(pod_type xid) const;
225 
226 protected:
227 
228 private:
229 
231 
232 
233  // ===========================================================
235  // ===========================================================
237 
238 public:
239 
243  static size_type handle_pool_ct();
244 
248  static size_type handle_pool_deep_size();
249 
253  virtual index_space_handle& get_id_space() const;
254 
258  virtual void release_id_space(index_space_handle& xid_space) const;
259 
264  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
265 
266 protected:
267 
268 private:
269 
273  static list_pool<primary_index_space_handle>& handles();
274 
276 
277 
278  // ===========================================================
280  // ===========================================================
282 
283 public:
284 
288  static size_type iterator_pool_ct();
289 
293  static size_type iterator_pool_deep_size();
294 
298  virtual index_space_iterator& get_iterator() const;
299 
303  virtual void release_iterator(index_space_iterator& xitr) const;
304 
309  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
310 
311 protected:
312 
313 private:
314 
318  static list_pool<primary_index_space_iterator>& iterators();
319 
321 
322 
323  // ===========================================================
325  // ===========================================================
327 
328 public:
329 
333  virtual const std::string& class_name() const;
334 
338  virtual primary_index_space_state* clone() const;
339 
340 protected:
341 
342 private:
343 
347  static bool make_prototype();
348 
350 
351 
352  // ===========================================================
354  // ===========================================================
356 
357 public:
358 
362  virtual bool is_ancestor_of(const any *other) const;
363 
367  virtual bool invariant() const;
368 
369 protected:
370 
371 private:
372 
374 
375 };
376 
377 // ===========================================================
378 // NON-MEMBER FUNCTIONS
379 // ===========================================================
380 
384 SHEAF_DLL_SPEC
385 size_t deep_size(const primary_index_space_state& xn, bool xinclude_shallow = true);
386 
387 } // end namespace sheaf
388 
389 #endif // ifndef PRIMARY_INDEX_SPACE_STATE_H
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...
An implementation of class explicit_index_space_handle that has a primary 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...
pod_type _hub_term_id
The term id of this in the hub id space.
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
primary_index_space_state(const primary_index_space_state &xother)
Copy constructor; disabled.
A computed implementation class explicit_index_space_state that is used for the terms of the primary ...
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.
Factory and container for a family of id spaces.
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
pod_type _offset
The offset into the hub id space.