SheafSystem  0.0.0.0
namespace_poset_dof_map.h
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 
18 // Interface for class namespace_poset_dof_map;
19 // map from client dof id to dof value
20 
21 #ifndef NAMESPACE_POSET_DOF_MAP_H
22 #define NAMESPACE_POSET_DOF_MAP_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef BLOCK_H
29 #include "SheafSystem/block.h"
30 #endif
31 
32 #ifndef POSET_DOF_MAP_H
33 #include "SheafSystem/poset_dof_map.h"
34 #endif
35 
36 #ifndef POSET_TYPE_H
37 #include "SheafSystem/poset_type.h"
38 #endif
39 
40 namespace sheaf
41 {
42 
43 class dof_map_factory;
44 class namespace_poset;
45 
49 class SHEAF_DLL_SPEC namespace_poset_dof_map : public poset_dof_map
50 {
51 
52  friend class poset_state_handle;
53  friend class namespace_poset;
54  friend class namespace_poset_member;
55 
56 public:
57 
61  virtual const std::string& class_name() const;
62 
66  static const std::string& static_class_name();
67 
68  // CANONICAL MEMBERS
69 
74 
78  virtual namespace_poset_dof_map* clone() const;
79 
84 
88  virtual namespace_poset_dof_map* copy() const;
89 
93  namespace_poset_dof_map& operator=(const namespace_poset_dof_map& xother);
94 
98  virtual ~namespace_poset_dof_map();
99 
103  virtual bool invariant() const;
104 
105  // OTHER CONSTRUCTORS
106 
112 
113  // MAP INTERFACE
114 
118  virtual dof_tuple_type type_id() const
119  {
120  return NAMESPACE_POSET_DOF_TUPLE_ID;
121  };
122 
123  // ===========================================================
124  // NEW DOF ACCESS FACET
125  // ===========================================================
126 
129 
133  virtual void get_dof(pod_index_type xdof_id, void* xdof, size_type xdof_size) const;
134 
138  virtual void put_dof(pod_index_type xdof_id, const void* xdof, size_type xdof_size);
139 
140 
141  // ===========================================================
142  // END NEW DOF ACCESS FACET
143  // ===========================================================
144 
148  virtual void* dof_tuple();
149 
153  virtual const void* dof_tuple() const;
154 
158  virtual void get_dof_tuple(void* xbuf, size_t xbuflen) const;
159 
163  virtual void put_dof_tuple(const void* xbuf, size_t xbuflen);
164 
169  poset_state_handle* poset_pointer() const;
170 
175  poset_type poset_type_id() const;
176 
181  const char* poset_class() const;
182 
187  int poset_prereq_id(int xi) const;
188 
189  // ===========================================================
190  // I/O SUPPORT FACET
191  // ===========================================================
192 
198  void extend_to_top();
199 
200 
201 protected:
202 
207  void put_poset_pointer(const poset_state_handle* xposet);
208 
213  void put_poset_type_id(poset_type xtype_id);
214 
219  void put_poset_class(const char* xclass);
220 
225  void put_poset_prereq_id(int xi, int xid);
226 
230  virtual void allocate_dofs();
231 
232 private:
233 
237  struct SHEAF_DLL_SPEC dof_struct
238  {
239  poset_state_handle* pointer;
240  int type_id;
241  const char* class_name;
242  int prereq_ids[5];
243  }
244  _dofs;
245 
251  block<pod_index_type> _storage_map;
252 
256  static bool make_prototype();
257 
258 };
259 
260 } // namespace sheaf
261 
262 #endif // ifndef NAMESPACE_POSET_DOF_MAP_H
263 
SHEAF_DLL_SPEC poset_type poset_type_id(int xi)
The poset type associated with int xi; converts int to poset type.
Definition: poset_type.cc:32
The default name space; a poset which contains other posets as members.
poset_type
Identifiers for poset types.
Definition: poset_type.h:41
A client handle for a general, abstract partially order set.
virtual void get_dof(pod_index_type xdof_id, void *xdof, size_type xdof_size) const
Copies the dof referred to by xdof_id into xdof.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
virtual dof_tuple_type type_id() const
An identifer for the type of dof tuple this is.
A client handle for a member of a namespace poset.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
dof_tuple_type
Identifiers for dof tuple types.
void put_dof(pod_index_type xdof_id, const primitive_value &xdof)
Sets the dof referred to by xdof_id to xdof.
int_type pod_index_type
The plain old data index type.
Definition: pod_types.h:49
Namespace for the sheaves component of the sheaf system.
A map from schema poset member ids to dof values for namespace_poset members.