SheafSystem  0.0.0.0
subposet_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 SUBPOSET_STATE_H
22 #define SUBPOSET_STATE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef DOF_DESCRIPTOR_ARRAY_H
29 #include "SheafSystem/dof_descriptor_array.h"
30 #endif
31 
32 #ifndef INDEX_SPACE_FAMILY_H
33 #include "SheafSystem/index_space_family.h"
34 #endif
35 
36 #ifndef SCATTERED_INSERTION_INDEX_SPACE_HANDLE_H
37 #include "SheafSystem/scattered_insertion_index_space_handle.h"
38 #endif
39 
40 #ifndef SCOPED_INDEX_H
41 #include "SheafSystem/scoped_index.h"
42 #endif
43 
44 #ifndef STD_STRING_H
45 #include "SheafSystem/std_string.h"
46 #endif
47 
48 #ifndef STD_IOSTREAM_H
49 #include "SheafSystem/std_iostream.h"
50 #endif
51 
52 #ifndef ZN_TO_BOOL_H
53 #include "SheafSystem/zn_to_bool.h"
54 #endif
55 
56 namespace sheaf
57 {
58 
59 template <typename T>
60 class block;
61 
65 class SHEAF_DLL_SPEC subposet_state
66 {
67  // ===========================================================
69  // ===========================================================
71 
72 public:
73 
78 
82  ~subposet_state();
83 
87  void initialize(int xmember_ub, const scoped_index& xindex, bool xinitialize);
88 
92  void initialize(int xmember_ub,
93  const scoped_index& xindex,
94  const block<pod_index_type>& xmembers);
95 
99  void initialize(int xmember_ub,
100  const scoped_index& xindex,
101  const block<scoped_index>& xmembers);
102 
106  bool is_initialized() const;
107 
111  void terminate();
112 
116  bool is_terminated() const;
117 
121  const scoped_index& next() const;
122 
126  void put_next(const scoped_index& xnext);
127 
131  zn_to_bool* members() const;
132 
136  void put_members(const zn_to_bool* xmembers);
137 
141  const scoped_index& index() const;
142 
146  bool is_dof_subposet() const;
147 
151  void put_is_dof_subposet(bool xis_dof_subposet);
152 
158  size_type dof_ct() const;
159 
165  void put_dof_ct(size_type xdof_ct);
166 
171  size_type dof_tuple_ub();
172 
177  dof_descriptor_array* dof_descriptors() const;
178 
183  void put_dof_descriptors(const dof_descriptor_array* xdof_descriptors);
184 
188  bool has_id_space() const;
189 
193  const scattered_insertion_index_space_handle& id_space() const;
194 
199 
203  void put_id_space(const index_space_family& xid_spaces,
204  pod_index_type xid);
205 
209  void put_id_space(const index_space_family& xid_spaces,
210  const std::string& xname);
211 
215  bool is_persistent() const;
216 
220  void put_is_persistent(bool xvalue);
221 
222 protected:
223 
228 
234 
239 
246 
252 
257 
262 
263 private:
264 
266 };
267 
268 
269 // ===========================================================
270 // NON-MEMBER FUNCTIONS
271 // ===========================================================
272 
276 SHEAF_DLL_SPEC
277 std::ostream & operator << (std::ostream &os, subposet_state& s);
278 
282 SHEAF_DLL_SPEC
283 size_t deep_size(const subposet_state& xp, bool xinclude_shallow = true);
284 
285 } // namespace sheaf
286 
287 #endif // ifndef SUBPOSET_STATE_H
zn_to_bool * _members
Characteristic function defining members of this subposet.
size_type _dof_ct
The number of dofs associated with this Only defined if this is a dofs subposet, in which case _dof_c...
scattered_insertion_index_space_handle * _id_space
The id space for this subposet state.
The data structure representing the state of a subposet.
A map from Zn (the integers mod n) to bools. A characteristic function used to represent subsets of Z...
Definition: zn_to_bool.h:52
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.
bool _is_persistent
True if and only if this subposet should be written to disk.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
bool _is_dof_subposet
True if this is a dofs subposet.
dof_descriptor_array * _dof_descriptors
If this is a dofs subposet, the offset of each dof when the dofs are contiguously allocated...
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
SHEAF_DLL_SPEC std::ostream & operator<<(std::ostream &os, const dof_descriptor_array &p)
Insert dof_descriptor_array& p into ostream& os.
A handle for a scattered_insertion_index_space_state.
Namespace for the sheaves component of the sheaf system.
Factory and container for a family of id spaces.
scoped_index _index
Index of this subposet in powerset::_member_pool also used for next().