SheafSystem  0.0.0.0
gathered_insertion_index_space_handle.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 GATHERED_INSERTION_INDEX_SPACE_HANDLE_H
22 #define GATHERED_INSERTION_INDEX_SPACE_HANDLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef EXPLICIT_INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/explicit_index_space_handle.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class gathered_insertion_index_space_state;
36 
41 {
42 
44  friend class id_space_names_record;
45 
46  // ===========================================================
48  // ===========================================================
50 
51 public:
52 
57 
62 
67 
71  gathered_insertion_index_space_handle(const index_space_family& xid_spaces, const std::string& xname);
72 
78 
83 
84 protected:
85 
87 
92 
96  const gathered_insertion_index_space_state& state() const;
97 
98 private:
99 
101 
102 
103  // ===========================================================
105  // ===========================================================
107 
108 public:
109 
114  void push_back(const scoped_index& xhub_id);
115 
119  void push_back(pod_type xid);
120 
127  void push(index_space_iterator& xitr, const scoped_index& xhub_id);
128 
134  void push(index_space_iterator& xitr, pod_type xhub_id);
135 
139  pod_type next_id() const;
140 
146  size_type remove(const scoped_index& xid, bool update_extrema);
147 
152  size_type remove(pod_type xid, bool update_extrema);
153 
158  size_type remove_hub(pod_type xhub_id, bool update_extrema);
159 
164  void remove(index_space_iterator& xitr, bool update_extrema);
165 
169  void gather();
170 
174  void update_extrema();
175 
179  void reserve(size_type xcapacity);
180 
184  size_type capacity() const;
185 
189  void clear();
190 
191 protected:
192 
193 private:
194 
196 
197 
198  // ===========================================================
200  // ===========================================================
202 
203 public:
204 
205 protected:
206 
207 private:
208 
210 
211 
212  // ===========================================================
214  // ===========================================================
216 
217 public:
218 
223  virtual gathered_insertion_index_space_handle& operator=(const index_space_handle& xother);
224 
229  virtual gathered_insertion_index_space_handle* clone() const;
230 
231 protected:
232 
233 private:
234 
236 
237 
238  // ===========================================================
240  // ===========================================================
242 
243 public:
244 
248  void put_is_persistent(bool xis_persistent);
249 
250 protected:
251 
252 private:
253 
255 
256 
257  // ===========================================================
259  // ===========================================================
261 
262 public:
263 
265 
270  virtual bool conforms_to_state(const index_space_collection& xhost, pod_type xlocal_id) const;
271 
272 protected:
273 
274 private:
275 
277 
278 
279  // ===========================================================
281  // ===========================================================
283 
284 public:
285 
289  virtual bool is_ancestor_of(const any *other) const;
290 
294  virtual bool invariant() const;
295 
296 protected:
297 
298 private:
299 
301 
302 };
303 
304 // ===========================================================
305 // NON-MEMBER FUNCTIONS
306 // ===========================================================
307 
311 SHEAF_DLL_SPEC
312 size_t deep_size(const gathered_insertion_index_space_handle& xn, bool xinclude_shallow = true);
313 
314 } // end namespace sheaf
315 
316 #endif // ifndef GATHERED_INSERTION_INDEX_SPACE_HANDLE_H
An abstract iterator over the ids of an id space.
An abstract handle to a space of alternate integer identifiers (aliases) for a subset of a hub set of...
explicit_index_space_state & state()
The explicit state (mutable version).
Abstract base class with useful features for all objects.
Definition: any.h:39
An implementation of class index_space_handle for an explicit_index_space_state.
pod_index_type pod_type
The "plain old data" index type for this.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
A handle for a gathered_insertion_index_space_state.
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.
A wrapper/adapter for the id space names record. Intended for transferring id map data between the ke...
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
A collection of id space states. This is a virtual class with provides an interface for accessing the...
virtual bool conforms_to_state(const index_space_collection &xhost, pod_type xlocal_id) const
True if this conforms to the handle type required by the state with local scope id xlocal_id in the h...
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.
An implementation of class explicit_index_space_state that supports gathered insertion of new members...
SHEAF_DLL_SPEC void push(const jcb &xjcb, const at1 &xvector, at1 &xresult, bool xauto_access)
Push vector forward (pre-allocated version for persistent types).
Definition: jcb.cc:1374