SheafSystem  0.0.0.0
forwarding_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 FORWARDING_INDEX_SPACE_HANDLE_H
22 #define FORWARDING_INDEX_SPACE_HANDLE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef INDEX_SPACE_HANDLE_H
29 #include "SheafSystem/index_space_handle.h"
30 #endif
31 
32 namespace sheaf
33 {
34 
35 class index_space_family;
36 
42 {
43 
44  friend class forwarding_index_space_state;
45 
46  // ===========================================================
48  // ===========================================================
50 
51 public:
52 
57 
62 
67  pod_type xindex);
68 
73  const std::string& xname);
74 
80 
85 
86 protected:
87 
92 
96  pod_type _local_id;
97 
98 private:
99 
101 
102 
103  // ===========================================================
105  // ===========================================================
107 
108 public:
109 
114  virtual forwarding_index_space_handle& operator=(const index_space_handle& xother);
115 
120  virtual forwarding_index_space_handle* clone() const;
121 
122 protected:
123 
124 private:
125 
127 
128 
129  // ===========================================================
131  // ===========================================================
133 
134 public:
135 
139  virtual const index_space_family& id_spaces() const;
140 
144  virtual index_space_family& id_spaces();
145 
149  virtual size_type ct() const;
150 
154  virtual pod_type begin() const;
155 
159  virtual pod_type end() const;
160 
162 
166  virtual bool contains(pod_type xid) const;
167 
171  virtual bool contains_unglued_hub(pod_type xid) const;
172 
176  virtual bool contains_glued_hub(pod_type xid) const;
177 
182  virtual bool contains(pod_type xid, pod_type xhub_id) const;
183 
185 
189  virtual pod_type pod(pod_type xid) const;
190 
194  virtual pod_type unglued_hub_pod(pod_type xid) const;
195 
200  virtual pod_type glued_hub_pod(pod_type xid) const;
201 
205  virtual bool is_persistent() const;
206 
207 protected:
208 
209 private:
210 
212 
213 
214  // ===========================================================
216  // ===========================================================
218 
219 public:
220 
225  virtual void new_product_structure(const abstract_product_structure& xproduct);
226 
230  virtual void delete_product_structure();
231 
233 
237  virtual const abstract_product_structure& product_structure() const;
238 
242  virtual abstract_product_structure& product_structure();
243 
247  virtual bool has_product_structure() const;
248 
249 protected:
250 
251 private:
252 
254 
255 
256  // ===========================================================
258  // ===========================================================
260 
261 public:
262 
266  virtual const index_space_collection& host() const;
267 
271  virtual pod_type index() const;
272 
276  virtual bool is_attached() const;
277 
279 
283  virtual void attach_to(pod_type xindex);
284 
289  virtual void attach_to(const index_space_collection& xhost,
290  pod_type xlocal_id);
291 
295  virtual void detach();
296 
298 
303  virtual bool conforms_to_state(const index_space_collection& xhost,
304  pod_type xlocal_id) const;
305 
306 protected:
307 
308 private:
309 
311 
312 
313  // ===========================================================
315  // ===========================================================
317 
318 public:
319 
323  virtual index_space_handle& get_id_space() const;
324 
328  virtual void release_id_space() const;
329 
334  virtual bool allocated_id_space() const;
335 
336 protected:
337 
338 private:
339 
341 
342 
343  // ===========================================================
345  // ===========================================================
347 
348 public:
349 
353  virtual index_space_iterator& get_iterator() const;
354 
358  virtual void release_iterator(index_space_iterator& xitr) const;
359 
364  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
365 
366 protected:
367 
368 private:
369 
371 
372 
373  // ===========================================================
375  // ===========================================================
377 
378 public:
379 
383  virtual bool is_ancestor_of(const any *other) const;
384 
388  virtual bool invariant() const;
389 
390 protected:
391 
392 private:
393 
395 
396 };
397 
398 // ===========================================================
399 // NON-MEMBER FUNCTIONS
400 // ===========================================================
401 
402 } // end namespace sheaf
403 
404 #endif // ifndef FORWARDING_INDEX_SPACE_HANDLE_H
An abstract class that defines the product structure for an id space.
virtual const abstract_product_structure & product_structure() const =0
The product structure for this id space (const version).
pod_type _local_id
The id of this space in the local scope of the host collection.
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...
virtual bool contains(pod_type xid) const =0
True if this space contains id xid.
Abstract base class with useful features for all objects.
Definition: any.h:39
An implementation of class index_space_handle for an forwarding_index_space_state.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
bool conforms_to_state(const index_space_family &xid_spaces, pod_type xindex) const
True if this conforms to the handle type required by the state with index xindex in the id space fami...
A collection of id space states. This is a virtual class with provides an interface for accessing the...
void attach_to(const index_space_family &xid_spaces, pod_type xindex)
Attach to the state with index xindex in the id space family xid_spaces.
virtual pod_type pod(pod_type xid) const =0
The pod index in this space equivalent to xid in the hub id space.
const index_space_collection * _host
The host collection.
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.