SheafSystem  0.0.0.0
poset_table_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 POSET_TABLE_STATE_H
22 #define POSET_TABLE_STATE_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef ANY_H
29 #include "SheafSystem/any.h"
30 #endif
31 
32 #ifndef BLOCK_H
33 #include "SheafSystem/block.h"
34 #endif
35 
36 #ifndef INDEX_SPACE_FAMILY_H
37 #include "SheafSystem/index_space_family.h"
38 #endif
39 
40 #ifndef SCOPED_INDEX_H
41 #include "SheafSystem/scoped_index.h"
42 #endif
43 
44 #ifndef STD_IOSTREAM_H
45 #include "SheafSystem/std_iostream.h"
46 #endif
47 
48 namespace sheaf
49 {
50 
51 class abstract_poset_member;
52 class array_poset_dof_map;
53 class poset_dof_map;
54 class poset_state_handle;
55 class schema_poset_member;
56 
61 class SHEAF_DLL_SPEC poset_table_state : public any
62 {
63 
64  friend class poset_state_handle;
65  friend class storage_agent; // needs to create id space.
66  friend class poset_scaffold; // needs to create an id space.
67  friend SHEAF_DLL_SPEC size_t deep_size(const poset_table_state& xp, bool xinclude_shallow);
68 
69 
70  // ===========================================================
72  // ===========================================================
74 
75 public:
76 
77 // ///
78 // /// Create an instance with schema xschema and
79 // /// initial storage for xcapacity dof tuples.
80 // ///
81 // poset_table_state(const schema_poset_member& xschema, size_type xcapacity);
82 
87  poset_table_state(const abstract_poset_member* xschema, size_type xcapacity);
88 
93 
97  schema_poset_member& schema();
98 
102  const schema_poset_member& schema() const;
103 
108 
112  void put_table_dofs(array_poset_dof_map* xtable_dofs);
113 
117  bool contains_row_dof_tuple(pod_index_type xindex) const;
118 
122  bool contains_row_dof_tuple(const scoped_index& xindex) const;
123 
127  size_type row_dof_tuple_ct() const;
128 
132  const scoped_index& row_dof_tuple_index_ub() const;
133 
138  size_type standard_row_dof_tuple_ct() const;
139 
144  void put_standard_row_dof_tuple_ct(size_type xct);
145 
149  poset_dof_map* row_dof_tuple(pod_index_type xindex);
150 
154  poset_dof_map* row_dof_tuple(const scoped_index& xindex);
155 
159  void put_row_dof_tuple(poset_dof_map* xdof_tuple);
160 
165  index_space_iterator& get_row_dof_tuple_id_space_iterator() const;
166 
170  void release_row_dof_tuple_id_space_iterator(index_space_iterator& xitr) const;
171 
172 protected:
173 
174 private:
175 
180 
185  schema_poset_member* _schema;
186 
190  array_poset_dof_map* _table_dofs;
191 
196 
201 
205  row_dofs_type _row_dof_tuples;
206 
210  scoped_index _row_dof_tuple_index_ub;
211 
216  size_type _standard_row_dof_tuple_ct;
217 
219 
220 
221  // ===========================================================
223  // ===========================================================
225 
226 public:
227 
231  const index_space_family& id_spaces() const;
232 
236  const hub_index_space_handle& hub_id_space() const;
237 
243  const scoped_index& hub_id() const;
244 
248  scoped_index hub_id(pod_index_type xid) const;
249 
250 protected:
251 
252 private:
253 
257  index_space_family _id_spaces;
258 
260 
261 
262  // ===========================================================
264  // ===========================================================
266 
267 public:
268 
272  virtual bool is_ancestor_of(const any* other) const;
273 
274 
278  virtual poset_table_state* clone() const;
279 
283  virtual bool invariant() const;
284 
285 protected:
286 
287 private:
288 
290 
291 };
292 
293 
294 // ===========================================================
295 // NONMEMBER FUNCTIONS
296 // ===========================================================
297 
301 SHEAF_DLL_SPEC
302 std::ostream& operator << (std::ostream &os, const poset_table_state& p);
303 
307 SHEAF_DLL_SPEC
308 size_t deep_size(const poset_table_state& xp, bool xinclude_shallow = true);
309 
310 } // namespace sheaf
311 
312 #endif // ifndef POSET_TABLE_STATE_H
An abstract iterator over the ids of an id space.
A client handle for a general, abstract partially order set.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
An implementation of class sum_index_space_handle that has a primary sum id space state...
A auto_block initialization policy that initializes the values to zero.
Definition: auto_block.h:102
Abstract base class with useful features for all objects.
Definition: any.h:39
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
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
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.
Namespace for the sheaves component of the sheaf system.
A poset specific collection of data converters, various buffers and other data used while transferrin...
An abstract client handle for a member of a poset.
Factory and container for a family of id spaces.
An array representation of abstract class poset_dof_map.
A client handle for a poset member which has been prepared for use as a schema.
The data structure representing the table containing the dof tuples of the members of a poset...
Agent responsible for importing and exporting posets from an external name space which resides on dis...
Definition: storage_agent.h:74