SheafSystem  0.0.0.0
gathered_insertion_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 GATHERED_INSERTION_INDEX_SPACE_STATE_H
22 #define GATHERED_INSERTION_INDEX_SPACE_STATE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef EXPLICIT_INDEX_SPACE_STATE_H
29 #include "SheafSystem/explicit_index_space_state.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class gathered_insertion_index_space_handle;
36 
43 {
44 
45  // ===========================================================
47  // ===========================================================
49 
50 public:
51 
52 protected:
53 
58 
63 
68 
69 private:
70 
72 
73 
74  // ===========================================================
76  // ===========================================================
78 
79 public:
80 
85  void push_back(const scoped_index& xhub_id);
86 
90  void push_back(pod_type xid);
91 
98  void push(index_space_iterator& xitr, const scoped_index& xhub_id);
99 
105  void push(index_space_iterator& xitr, pod_type xhub_id);
106 
110  pod_type next_id() const;
111 
117  size_type remove(const scoped_index& xid, bool update_extrema);
118 
123  size_type remove(pod_type xid, bool update_extrema);
124 
129  size_type remove_hub(pod_type xhub_id, bool update_extrema);
130 
135  void remove(index_space_iterator& xitr, bool update_extrema);
136 
140  void gather();
141 
145  virtual void update_extrema() = 0;
146 
150  virtual void reserve(size_type xcapacity) = 0;
151 
155  virtual size_type capacity() const = 0;
156 
160  void clear();
161 
162 protected:
163 
167  virtual void update_extrema_after_remove();
168 
172  void update_extrema(pod_type xid);
173 
174 private:
175 
177 
178 
179  // ===========================================================
181  // ===========================================================
183 
184 public:
185 
186 protected:
187 
191  virtual void map_rep_push_back(pod_type xrange_id) = 0;
192 
198  virtual void map_rep_push(index_space_iterator& xitr, pod_type xrange_id) = 0;
199 
205  virtual size_type map_rep_remove_entry(pod_type xid, bool xis_range_id) = 0;
206 
211  virtual void map_rep_remove_entry(index_space_iterator& xitr) = 0;
212 
216  virtual void map_rep_clear() = 0;
217 
221  virtual void map_rep_gather() = 0;
222 
223 private:
224 
226 
227 
228  // ===========================================================
230  // ===========================================================
232 
233 public:
234 
238  virtual bool operator==(const explicit_index_space_state& xother) const;
239 
240 protected:
241 
245  virtual gathered_insertion_index_space_state& operator=(const explicit_index_space_state& xother);
246 
247 private:
248 
250 
251 
252  // ===========================================================
254  // ===========================================================
256 
257 public:
258 
262  void put_is_persistent(bool xis_persistent);
263 
264 protected:
265 
266 private:
267 
269 
270 
271  // ===========================================================
273  // ===========================================================
275 
276 public:
277 
281  virtual const std::string& class_name() const;
282 
283 protected:
284 
285 private:
286 
288 
289 
290  // ===========================================================
292  // ===========================================================
294 
295 public:
296 
300  virtual bool is_ancestor_of(const any *other) const;
301 
305  virtual bool invariant() const;
306 
307 protected:
308 
309 private:
310 
312 
313 };
314 
315 // ===========================================================
316 // NON-MEMBER FUNCTIONS
317 // ===========================================================
318 
322 SHEAF_DLL_SPEC
323 size_t deep_size(const gathered_insertion_index_space_state& xn, bool xinclude_shallow = true);
324 
325 } // end namespace sheaf
326 
327 #endif // ifndef GATHERED_INSERTION_INDEX_SPACE_STATE_H
An abstract iterator over the ids of an id space.
gathered_insertion_index_space_state(const gathered_insertion_index_space_state &xother)
Copy constructor; disabled.
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...
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
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.
pod_index_type pod_type
The "plain old data" index type for this.
Namespace for the sheaves component of the sheaf system.
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