SheafSystem  0.0.0.0
primitives_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 PRIMITIVES_INDEX_SPACE_STATE_H
22 #define PRIMITIVES_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 primitives_index_space_handle;
40 class primitives_index_space_iterator;
41 
47 {
48 
49  friend class namespace_poset;
50 
51  // ===========================================================
53  // ===========================================================
55 
56 public:
57 
63  static primitives_index_space_handle new_space(index_space_family& xid_spaces,
64  const std::string& xname);
65 
71  static primitives_index_space_handle new_space(index_space_family& xid_spaces,
72  pod_type xid,
73  const std::string& xname);
74 
75 protected:
76 
77 private:
78 
80 
81 
82  // ===========================================================
84  // ===========================================================
86 
87 public:
88 
89 protected:
90 
95 
100 
104  virtual ~primitives_index_space_state();
105 
106 private:
107 
109 
110 
111  // ===========================================================
113  // ===========================================================
115 
116 public:
117 
121  virtual bool operator==(const explicit_index_space_state& xother) const;
122 
126  virtual size_type deep_size(bool xinclude_shallow) const;
127 
128 protected:
129 
133  virtual primitives_index_space_state& operator=(const explicit_index_space_state& xother);
134 
135 private:
136 
138 
139 
140  // ===========================================================
142  // ===========================================================
144 
145 public:
146 
150  virtual bool contains(pod_type xid) const;
151 
155  virtual bool contains_unglued_hub(pod_type xid) const;
156 
160  virtual pod_type pod(pod_type xid) const;
161 
165  virtual pod_type unglued_hub_pod(pod_type xid) const;
166 
167 protected:
168 
169 private:
170 
172 
173 
174  // ===========================================================
176  // ===========================================================
178 
179 public:
180 
184  static size_type handle_pool_ct();
185 
189  static size_type handle_pool_deep_size();
190 
194  virtual index_space_handle& get_id_space() const;
195 
199  virtual void release_id_space(index_space_handle& xid_space) const;
200 
205  virtual bool allocated_id_space(const index_space_handle& xid_space) const;
206 
207 protected:
208 
209 private:
210 
215 
217 
218 
219  // ===========================================================
221  // ===========================================================
223 
224 public:
225 
229  static size_type iterator_pool_ct();
230 
234  static size_type iterator_pool_deep_size();
235 
239  virtual index_space_iterator& get_iterator() const;
240 
244  virtual void release_iterator(index_space_iterator& xitr) const;
245 
250  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
251 
252 protected:
253 
254 private:
255 
259  static list_pool<primitives_index_space_iterator>& iterators();
260 
262 
263 
264  // ===========================================================
266  // ===========================================================
268 
269 public:
270 
274  virtual const std::string& class_name() const;
275 
279  virtual primitives_index_space_state* clone() const;
280 
281 protected:
282 
283 private:
284 
288  static bool make_prototype();
289 
291 
292 
293  // ===========================================================
295  // ===========================================================
297 
298 public:
299 
303  virtual bool is_ancestor_of(const any *other) const;
304 
308  virtual bool invariant() const;
309 
310 protected:
311 
312 private:
313 
315 
316 };
317 
318 // ===========================================================
319 // NON-MEMBER FUNCTIONS
320 // ===========================================================
321 
325 SHEAF_DLL_SPEC
326 size_t deep_size(const primitives_index_space_state& xn, bool xinclude_shallow = true);
327 
328 } // end namespace sheaf
329 
330 #endif // ifndef PRIMITIVES_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
A implementation of abstract class explicit_index_space_state for the primitives row dof id space...
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
primitives_index_space_state(const primitives_index_space_state &xother)
Copy constructor; disabled.
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 primitives id space state...
pod_index_type pod_type
The "plain old data" index type for this.
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