SheafSystem  0.0.0.0
index_space_interval.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 INDEX_SPACE_INTERVAL_H
22 #define INDEX_SPACE_INTERVAL_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef FACTORY_H
29 #include "SheafSystem/factory.h"
30 #endif
31 
32 #ifndef INDEX_SPACE_COLLECTION_H
33 #include "SheafSystem/index_space_collection.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
43 class SHEAF_DLL_SPEC index_space_interval : public index_space_collection
44 {
45 
46  friend class index_space_family_iterator;
47  friend class index_space_interval_iterator;
48 
49  // ===========================================================
51  // ===========================================================
53 
54 public:
55 
59  virtual ~index_space_interval();
60 
62 
66  pod_type begin() const;
67 
69 
73  pod_type end() const;
74 
78  bool in_bounds(pod_type xspace_id) const;
79 
80 protected:
81 
86 
91 
96  void new_state(index_space_family& xid_spaces, size_type xub);
97 
101  virtual bool supports_persistent_id_spaces() const;
102 
106  pod_type _begin;
107 
111  pod_type _end;
112 
113 private:
114 
116 
117 
118  // ===========================================================
120  // ===========================================================
122 
123 public:
124 
128  virtual bool operator==(const index_space_collection& xother) const;
129 
131 
135  virtual bool contains(pod_type xlocal_id) const;
136 
140  virtual bool contains_family(pod_type xspace_id) const;
141 
145  virtual pod_type local_scope(pod_type xspace_id) const;
146 
150  virtual pod_type family_scope(pod_type xlocal_id) const;
151 
152 protected:
153 
157  virtual index_space_interval& operator=(const index_space_collection& xother);
158 
159 private:
160 
162 
163 
164  // ===========================================================
166  // ===========================================================
168 
169 public:
170 
174  virtual const index_space_family& id_spaces() const;
175 
179  virtual index_space_family& id_spaces();
180 
181 protected:
182 
187 
188 private:
189 
191 
192 
193  // ===========================================================
195  // ===========================================================
197 
198 public:
199 
203  virtual const std::string& class_name() const;
204 
208  static factory<index_space_interval>& id_space_interval_factory();
209 
213  virtual index_space_interval* clone() const = 0;
214 
215 protected:
216 
217 private:
218 
220 
221 
222  // ===========================================================
224  // ===========================================================
226 
227 public:
228 
232  virtual bool is_ancestor_of(const any *other) const;
233 
237  virtual bool invariant() const;
238 
239 protected:
240 
241 private:
242 
244 
245 };
246 
247 // ===========================================================
248 // NON-MEMBER FUNCTIONS
249 // ===========================================================
250 
254 SHEAF_DLL_SPEC
255 std::ostream & operator << (std::ostream &xos, const index_space_interval& xn);
256 
257 } // end namespace sheaf
258 
259 #endif // ifndef INDEX_SPACE_INTERVAL_H
index_space_interval(const index_space_interval &xother)
Copy constructor; disabled.
virtual pod_type end(pod_type xlocal_id) const =0
Ending id of the space with id xlocal_id.
index_space_family * _id_spaces
The index space family of this collection.
An abstract iterator over the id spaces of a interval.
Abstract base class with useful features for all objects.
Definition: any.h:39
An implemenation of index_space_collection that adds an interface for the interval [begin()...
pod_type _begin
Beginning space id of this interval in the id space family scope.
virtual pod_type begin(pod_type xlocal_id) const =0
Beginning id of the space with id xlocal_id.
A factory for instanting descendants of an abstract type T, given the class name of the descendant...
Definition: eval_family.h:49
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
pod_type _end
Ending space id of this interval in the id space family scope.
A collection of id space states. This is a virtual class with provides an interface for accessing the...
virtual bool contains(pod_type xlocal_id) const =0
True if this collection contains the id space with local id xlocal_id.
An abstract iterator over the id spaces of a interval.
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.
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.