SheafSystem  0.0.0.0
explicit_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 EXPLICIT_INDEX_SPACE_HANDLE_H
22 #define EXPLICIT_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 explicit_index_space_state;
36 class index_space_family;
37 
42 class SHEAF_DLL_SPEC explicit_index_space_handle : public index_space_handle
43 {
44 
45  friend class explicit_index_space_state;
46 
47  // ===========================================================
49  // ===========================================================
51 
52 public:
53 
58 
63 
68  pod_type xindex);
69 
74  const std::string& xname);
75 
81 
85  virtual ~explicit_index_space_handle();
86 
87 protected:
88 
93 
97  const explicit_index_space_state& state() const;
98 
103 
104 private:
105 
107 
108 
109  // ===========================================================
111  // ===========================================================
113 
114 public:
115 
120  virtual explicit_index_space_handle& operator=(const index_space_handle& xother);
121 
126  virtual explicit_index_space_handle* clone() const;
127 
128 protected:
129 
130 private:
131 
133 
134 
135  // ===========================================================
137  // ===========================================================
139 
140 public:
141 
145  virtual const index_space_family& id_spaces() const;
146 
150  virtual index_space_family& id_spaces();
151 
155  virtual size_type ct() const;
156 
160  virtual pod_type begin() const;
161 
165  virtual pod_type end() const;
166 
168 
172  virtual bool contains(pod_type xid) const;
173 
177  virtual bool contains_unglued_hub(pod_type xid) const;
178 
182  virtual bool contains_glued_hub(pod_type xid) const;
183 
188  virtual bool contains(pod_type xid, pod_type xhub_id) const;
189 
191 
195  virtual pod_type pod(pod_type xid) const;
196 
200  virtual pod_type unglued_hub_pod(pod_type xid) const;
201 
206  virtual pod_type glued_hub_pod(pod_type xid) const;
207 
211  virtual bool is_persistent() const;
212 
213 protected:
214 
215 private:
216 
218 
219 
220  // ===========================================================
222  // ===========================================================
224 
225 public:
226 
231  virtual void new_product_structure(const abstract_product_structure& xproduct);
232 
236  virtual void delete_product_structure();
237 
239 
243  virtual const abstract_product_structure& product_structure() const;
244 
248  virtual abstract_product_structure& product_structure();
249 
253  virtual bool has_product_structure() const;
254 
255 protected:
256 
257 private:
258 
260 
261 
262  // ===========================================================
264  // ===========================================================
266 
267 public:
268 
272  virtual const index_space_collection& host() const;
273 
277  virtual pod_type index() const;
278 
282  virtual bool is_attached() const;
283 
285 
289  virtual void attach_to(pod_type xindex);
290 
295  virtual void attach_to(const index_space_collection& xhost,
296  pod_type xlocal_id);
297 
301  virtual void detach();
302 
304 
309  virtual bool conforms_to_state(const index_space_collection& xhost,
310  pod_type xlocal_id) const;
311 
312 protected:
313 
317  void attach_to(explicit_index_space_state* xstate);
318 
323  virtual bool conforms_to_state(explicit_index_space_state* xstate) const;
324 
329  explicit_index_space_state* state(pod_type xindex) const;
330 
336  pod_type xlocal_id) const;
337 
338 private:
339 
341 
342 
343  // ===========================================================
345  // ===========================================================
347 
348 public:
349 
353  virtual index_space_handle& get_id_space() const;
354 
358  virtual void release_id_space() const;
359 
364  virtual bool allocated_id_space() const;
365 
366 protected:
367 
368 private:
369 
371 
372 
373  // ===========================================================
375  // ===========================================================
377 
378 public:
379 
383  virtual index_space_iterator& get_iterator() const;
384 
388  virtual void release_iterator(index_space_iterator& xitr) const;
389 
394  virtual bool allocated_iterator(const index_space_iterator& xitr) const;
395 
396 protected:
397 
398 private:
399 
401 
402 
403  // ===========================================================
405  // ===========================================================
407 
408 public:
409 
413  virtual bool is_ancestor_of(const any *other) const;
414 
418  virtual bool invariant() const;
419 
420 protected:
421 
422 private:
423 
425 
426 };
427 
428 // ===========================================================
429 // NON-MEMBER FUNCTIONS
430 // ===========================================================
431 
432 } // end namespace sheaf
433 
434 #endif // ifndef EXPLICIT_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).
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 immutable abstract state for a space of alternate integer identifiers (aliases) for a subset of th...
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.
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.
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.
explicit_index_space_state * _state
The explicit state.