SheafSystem  0.0.0.0
offset_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 OFFSET_INDEX_SPACE_STATE_H
22 #define OFFSET_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 offset_index_space_handle;
40 class offset_index_space_iterator;
41 
49 {
50 
51  friend class namespace_poset;
52 
53  // ===========================================================
55  // ===========================================================
57 
58 public:
59 
66  static offset_index_space_handle new_space(index_space_family& xid_spaces,
67  const std::string& xname,
68  pod_type xoffset,
69  size_type xct);
70 
76  static offset_index_space_handle new_space(index_space_family& xid_spaces,
77  pod_type xid,
78  const std::string& xname,
79  pod_type xoffset,
80  size_type xct);
81 
82 protected:
83 
84 private:
85 
87 
88 
89  // ===========================================================
91  // ===========================================================
93 
94 public:
95 
96 protected:
97 
102 
107 
111  virtual ~offset_index_space_state();
112 
113 private:
114 
116 
117 
118  // ===========================================================
120  // ===========================================================
122 
123 public:
124 
128  pod_type offset() const;
129 
130 protected:
131 
135  pod_type _offset;
136 
137 private:
138 
140 
141 
142  // ===========================================================
144  // ===========================================================
146 
147 public:
148 
152  virtual bool operator==(const explicit_index_space_state& xother) const;
153 
157  virtual size_type deep_size(bool xinclude_shallow) const;
158 
159 protected:
160 
164  virtual offset_index_space_state& operator=(const explicit_index_space_state& xother);
165 
166 private:
167 
169 
170 
171  // ===========================================================
173  // ===========================================================
175 
176 public:
177 
181  virtual bool contains(pod_type xid) const;
182 
186  virtual bool contains_unglued_hub(pod_type xid) const;
187 
191  virtual pod_type pod(pod_type xid) const;
192 
196  virtual pod_type unglued_hub_pod(pod_type xid) const;
197 
198 protected:
199 
200 private:
201 
203 
204 
205  // ===========================================================
207  // ===========================================================
209 
210 public:
211 
215  static size_type handle_pool_ct();
216 
220  static size_type handle_pool_deep_size();
221 
225  virtual index_space_handle& get_id_space() const;
226 
230  virtual void release_id_space(index_space_handle& xid_space) const;
231 
236  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
237 
238 protected:
239 
240 private:
241 
245  static list_pool<offset_index_space_handle>& handles();
246 
248 
249 
250  // ===========================================================
252  // ===========================================================
254 
255 public:
256 
260  static size_type iterator_pool_ct();
261 
265  static size_type iterator_pool_deep_size();
266 
270  virtual index_space_iterator& get_iterator() const;
271 
275  virtual void release_iterator(index_space_iterator& xitr) const;
276 
281  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
282 
283 protected:
284 
285 private:
286 
290  static list_pool<offset_index_space_iterator>& iterators();
291 
293 
294 
295  // ===========================================================
297  // ===========================================================
299 
300 public:
301 
305  virtual const std::string& class_name() const;
306 
310  virtual offset_index_space_state* clone() const;
311 
312 protected:
313 
314 private:
315 
319  static bool make_prototype();
320 
322 
323 
324  // ===========================================================
326  // ===========================================================
328 
329 public:
330 
334  virtual bool is_ancestor_of(const any *other) const;
335 
339  virtual bool invariant() const;
340 
341 protected:
342 
343 private:
344 
346 
347 };
348 
349 // ===========================================================
350 // NON-MEMBER FUNCTIONS
351 // ===========================================================
352 
356 SHEAF_DLL_SPEC
357 size_t deep_size(const offset_index_space_state& xn, bool xinclude_shallow = true);
358 
359 } // end namespace sheaf
360 
361 #endif // ifndef OFFSET_INDEX_SPACE_STATE_H
pod_type _offset
The offset into the hub id space.
An abstract iterator over the ids of an id space.
The default name space; a poset which contains other posets as members.
An implementation of class explicit_index_space_handle that has a offset id space state...
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 computed implementation of abstract class explicit_index_space_state. This representation assumes t...
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.
offset_index_space_state(const offset_index_space_state &xother)
Copy constructor; disabled.
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