SheafSystem  0.0.0.0
singleton_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 SINGLETON_INDEX_SPACE_STATE_H
22 #define SINGLETON_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 singleton_index_space_handle;
40 class singleton_index_space_iterator;
41 
47 {
48 
49  friend class namespace_poset;
50 
51  // ===========================================================
53  // ===========================================================
55 
56 public:
57 
64  static singleton_index_space_handle new_space(index_space_family& xid_spaces,
65  const std::string& xname,
66  pod_type xhub_id);
67 
73  static singleton_index_space_handle new_space(index_space_family& xid_spaces,
74  pod_type xid,
75  const std::string& xname,
76  pod_type xhub_id);
77 
78 protected:
79 
80 private:
81 
83 
84 
85  // ===========================================================
87  // ===========================================================
89 
90 public:
91 
92 protected:
93 
98 
103 
107  virtual ~singleton_index_space_state();
108 
109 private:
110 
112 
113 
114  // ===========================================================
116  // ===========================================================
118 
119 public:
120 
124  pod_type hub_id() const;
125 
126 protected:
127 
128 private:
129 
133  pod_type _hub_id;
134 
136 
137 
138  // ===========================================================
140  // ===========================================================
142 
143 public:
144 
148  virtual bool operator==(const explicit_index_space_state& xother) const;
149 
153  virtual size_type deep_size(bool xinclude_shallow) const;
154 
155 protected:
156 
160  virtual singleton_index_space_state& operator=(const explicit_index_space_state& xother);
161 
162 private:
163 
165 
166 
167  // ===========================================================
169  // ===========================================================
171 
172 public:
173 
177  virtual bool contains(pod_type xid) const;
178 
182  virtual bool contains_unglued_hub(pod_type xid) const;
183 
187  virtual pod_type pod(pod_type xid) const;
188 
192  virtual pod_type unglued_hub_pod(pod_type xid) const;
193 
194 protected:
195 
196 private:
197 
199 
200 
201  // ===========================================================
203  // ===========================================================
205 
206 public:
207 
211  static size_type handle_pool_ct();
212 
216  static size_type handle_pool_deep_size();
217 
221  virtual index_space_handle& get_id_space() const;
222 
226  virtual void release_id_space(index_space_handle& xid_space) const;
227 
232  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
233 
234 protected:
235 
236 private:
237 
241  static list_pool<singleton_index_space_handle>& handles();
242 
244 
245 
246  // ===========================================================
248  // ===========================================================
250 
251 public:
252 
256  static size_type iterator_pool_ct();
257 
261  static size_type iterator_pool_deep_size();
262 
266  virtual index_space_iterator& get_iterator() const;
267 
271  virtual void release_iterator(index_space_iterator& xitr) const;
272 
277  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
278 
279 protected:
280 
281 private:
282 
286  static list_pool<singleton_index_space_iterator>& iterators();
287 
289 
290 
291  // ===========================================================
293  // ===========================================================
295 
296 public:
297 
301  virtual const std::string& class_name() const;
302 
306  virtual singleton_index_space_state* clone() const;
307 
308 protected:
309 
310 private:
311 
315  static bool make_prototype();
316 
318 
319 
320  // ===========================================================
322  // ===========================================================
324 
325 public:
326 
330  virtual bool is_ancestor_of(const any *other) const;
331 
335  virtual bool invariant() const;
336 
337 protected:
338 
339 private:
340 
342 
343 };
344 
345 // ===========================================================
346 // NON-MEMBER FUNCTIONS
347 // ===========================================================
348 
352 SHEAF_DLL_SPEC
353 size_t deep_size(const singleton_index_space_state& xn, bool xinclude_shallow = true);
354 
355 } // end namespace sheaf
356 
357 #endif // ifndef SINGLETON_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...
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
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 explicit_index_space_handle that has a singleton id space state...
singleton_index_space_state(const singleton_index_space_state &xother)
Copy constructor; disabled.
Namespace for the sheaves component of the sheaf system.
An implementation of explicit_index_space_state for an id space containing a single id...
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