SheafSystem  0.0.0.0
reserved_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 RESERVED_PRIMARY_INDEX_SPACE_STATE_H
22 #define RESERVED_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 PRIMARY_INDEX_SPACE_STATE_H
33 #include "SheafSystem/primary_index_space_state.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class reserved_primary_index_space_handle;
40 class reserved_primary_index_space_iterator;
41 
47 {
48 
49  friend class namespace_poset;
50 
51  // ===========================================================
53  // ===========================================================
55 
56 public:
57 
64  static reserved_primary_index_space_handle new_space(index_space_family& xid_spaces,
65  const std::string& xname,
66  pod_type xoffset,
67  size_type xct);
68 
74  static reserved_primary_index_space_handle new_space(index_space_family& xid_spaces,
75  pod_type xid,
76  const std::string& xname,
77  pod_type xoffset,
78  size_type xct);
79 
80 protected:
81 
82 private:
83 
85 
86 
87  // ===========================================================
89  // ===========================================================
91 
92 public:
93 
94 protected:
95 
100 
105 
110 
111 private:
112 
114 
115 
116  // ===========================================================
118  // ===========================================================
120 
121 public:
122 
127  pod_type new_id();
128 
133  pod_type new_hub_id(pod_type xhub_id);
134 
138  pod_type next_hub_id() const;
139 
143  bool is_next_id_available() const;
144 
148  bool is_hub_id_available(pod_type xhub_id) const;
149 
150 protected:
151 
154  pod_type _next_hub_id;
155 
156 private:
157 
159 
160 
161  // ===========================================================
163  // ===========================================================
165 
166 public:
167 
168 protected:
169 
170 private:
171 
173 
174 
175  // ===========================================================
177  // ===========================================================
179 
180 public:
181 
185  virtual bool operator==(const explicit_index_space_state& xother) const;
186 
190  virtual size_type deep_size(bool xinclude_shallow) const;
191 
192 protected:
193 
197  virtual reserved_primary_index_space_state& operator=(const explicit_index_space_state& xother);
198 
199 private:
200 
202 
203 
204  // ===========================================================
206  // ===========================================================
208 
209 public:
210 
211 protected:
212 
213 private:
214 
216 
217 
218  // ===========================================================
220  // ===========================================================
222 
223 public:
224 
228  static size_type handle_pool_ct();
229 
233  static size_type handle_pool_deep_size();
234 
238  virtual index_space_handle& get_id_space() const;
239 
243  virtual void release_id_space(index_space_handle& xid_space) const;
244 
249  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
250 
251 protected:
252 
253 private:
254 
259 
261 
262 
263  // ===========================================================
265  // ===========================================================
267 
268 public:
269 
273  static size_type iterator_pool_ct();
274 
278  static size_type iterator_pool_deep_size();
279 
283  virtual index_space_iterator& get_iterator() const;
284 
288  virtual void release_iterator(index_space_iterator& xitr) const;
289 
294  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
295 
296 protected:
297 
298 private:
299 
304 
306 
307 
308  // ===========================================================
310  // ===========================================================
312 
313 public:
314 
318  virtual const std::string& class_name() const;
319 
323  virtual reserved_primary_index_space_state* clone() const;
324 
325 protected:
326 
327 private:
328 
332  static bool make_prototype();
333 
335 
336 
337  // ===========================================================
339  // ===========================================================
341 
342 public:
343 
347  virtual bool is_ancestor_of(const any *other) const;
348 
352  virtual bool invariant() const;
353 
354 protected:
355 
356 private:
357 
359 
360 };
361 
362 // ===========================================================
363 // NON-MEMBER FUNCTIONS
364 // ===========================================================
365 
369 SHEAF_DLL_SPEC
370 size_t deep_size(const reserved_primary_index_space_state& xn, bool xinclude_shallow = true);
371 
372 } // end namespace sheaf
373 
374 #endif // ifndef RESERVED_PRIMARY_INDEX_SPACE_STATE_H
An abstract iterator over the ids of an id space.
A computed implementation of abstract class primary_index_space_state. This representation is used fo...
reserved_primary_index_space_state(const reserved_primary_index_space_state &xother)
Copy constructor; disabled.
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...
pod_type _next_hub_id
The next available hub id for allocation.
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 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.
An implementation of class primary_index_space_handle that has a reserved primary id space state...
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