SheafSystem  0.0.0.0
primitives_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 primitives_poset_dof_map;
19 // map from client dof id to dof value
20 
21 #ifndef PRIMITIVES_POSET_DOF_MAP_H
22 #define PRIMITIVES_POSET_DOF_MAP_H
23 
24 #ifndef SHEAF_DLL_SPEC_H
25 #include "SheafSystem/sheaf_dll_spec.h"
26 #endif
27 
28 #ifndef POSET_DOF_MAP_H
29 #include "SheafSystem/poset_dof_map.h"
30 #endif
31 
32 #ifndef PRIMITIVE_TYPE_H
33 #include "SheafSystem/primitive_type.h"
34 #endif
35 
36 namespace sheaf
37 {
38 
39 class dof_map_factory;
40 class primitives_poset;
41 
45 class SHEAF_DLL_SPEC primitives_poset_dof_map : public poset_dof_map
46 {
47 
48  friend class namespace_poset;
49 
50 public:
51 
55  virtual const std::string& class_name() const;
56 
60  static const std::string& static_class_name();
61 
62  // CANONICAL MEMBERS
63 
68 
72  virtual primitives_poset_dof_map* clone() const;
73 
78 
82  virtual primitives_poset_dof_map* copy() const;
83 
87  primitives_poset_dof_map& operator=(const primitives_poset_dof_map& xother);
88 
92  virtual ~primitives_poset_dof_map();
93 
97  virtual bool invariant() const;
98 
99  // OTHER CONSTRUCTORS
100 
104  primitives_poset_dof_map(const poset_state_handle* xhost, int xprimitive_index);
105 
111  virtual void init_row_dof_map(const poset_state_handle* xhost,
112  pod_index_type xschema_mbr_id,
113  int xschema_version);
114 
115  // MAP INTERFACE
116 
120  virtual dof_tuple_type type_id() const
121  {
122  return PRIMITIVES_POSET_DOF_TUPLE_ID;
123  };
124 
127 
128  // ===========================================================
129  // NEW DOF ACCESS FACET
130  // ===========================================================
131 
135  virtual void get_dof(pod_index_type xdof_id, void* xdof, size_type xdof_size) const;
136 
140  virtual void put_dof(pod_index_type xdof_id, const void* xdof, size_type xdof_size);
141 
142 
143  // ===========================================================
144  // END NEW DOF ACCESS FACET
145  // ===========================================================
146 
150  virtual void* dof_tuple();
151 
155  virtual const void* dof_tuple() const;
156 
160  virtual void get_dof_tuple(void* xbuf, size_t xbuflen) const;
161 
165  virtual void put_dof_tuple(const void* xbuf, size_t xbuflen);
166 
170  size_t size() const;
171 
175  void put_size(size_t xsize);
176 
180  size_t alignment() const;
181 
185  void put_alignment(size_t xalignment);
186 
192  primitive_type type() const;
193 
199  void put_type(int xindex);
200 
201 protected:
202 
206  virtual void put_host(const poset_state_handle* xhost);
207 
211  virtual void allocate_dofs() {};
212 
213 
214 private:
215 
219  primitive_descriptor _dofs;
220 
224  static bool make_prototype();
225 
226 };
227 
228 // ===========================================================
229 // NON-MEMBER FUNCTIONS
230 // ===========================================================
231 
232 } // namespace sheaf
233 
234 #endif // ifndef PRIMITIVES_POSET_DOF_MAP_H
235 
virtual dof_tuple_type type_id() const
An identifer for the type of dof tuple this is.
The default name space; a poset which contains other posets as members.
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.
virtual void allocate_dofs()
Allocates dof storage.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
primitive_type
Type ids for sheaf primitives.
A map from schema poset member ids to dof values for primitives_poset members.
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.