SheafSystem  0.0.0.0
array_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 array_poset_dof_map;
19 // map from client dof id to dof value
20 
21 #ifndef ARRAY_POSET_DOF_MAP_H
22 #define ARRAY_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 namespace sheaf
33 {
34 
35 class dof_descriptor_array;
36 class dof_map_factory;
37 class poset_dof_iterator;
38 class schema_poset_member;
39 
43 class SHEAF_DLL_SPEC array_poset_dof_map : public poset_dof_map
44 {
45 
46  friend class namespace_poset;
47 
48 public:
49 
53  virtual const std::string& class_name() const;
54 
58  static const std::string& static_class_name();
59 
60  // CANONICAL MEMBERS
61 
67 
71  virtual array_poset_dof_map* clone() const;
72 
77 
81  virtual array_poset_dof_map* copy() const;
82 
86  array_poset_dof_map& operator=(const array_poset_dof_map& xother);
87 
91  virtual ~array_poset_dof_map();
92 
96  virtual bool invariant() const;
97 
98  // OTHER CONSTRUCTORS
99 
107  bool xis_table_dof_map,
108  void* xdofs = 0,
109  size_t xdofs_ub = 0);
110 
117  array_poset_dof_map(const schema_poset_member* xschema, bool xis_table_dof_map);
118 
119  // ===========================================================
120  // MAP FACET
121  // ===========================================================
122 
126  virtual dof_tuple_type type_id() const;
127 
130 
131  // ===========================================================
132  // NEW DOF ACCESS FACET
133  // ===========================================================
134 
138  virtual void get_dof(pod_index_type xdof_id, void* xdof, size_type xdof_size) const;
139 
143  virtual void put_dof(pod_index_type xdof_id, const void* xdof, size_type xdof_size);
144 
145 
146  // ===========================================================
147  // END NEW DOF ACCESS FACET
148  // ===========================================================
149 
153  virtual void* dof_tuple();
154 
158  virtual const void* dof_tuple() const;
159 
161 
165  virtual void get_dof_tuple(void* xbuf, size_t xbuflen) const;
166 
168 
172  virtual void put_dof_tuple(const void* xbuf, size_t xbuflen);
173 
177  char* dof_ptr(const schema_poset_member& xschema_mbr);
178 
182  char* dof_ptr(int xclient_id);
183 
187  inline char* dofs()
188  {
189  return static_cast<char*>(dof_tuple());
190  }
191 
195  inline const char* dofs() const
196  {
197  return static_cast<const char*>(dof_tuple());
198  }
199 
200 
201 protected:
202 
206  void init_dofs(void* xdofs);
207 
211  virtual void allocate_dofs();
212 
217  bool dof_in_bounds(pod_index_type xdof_id) const;
218 
219 private:
220 
224  dof_descriptor_array* _dof_descriptors;
225 
229  char* _dofs;
230 
234  bool _this_owns_dofs;
235 
239  static bool make_prototype();
240 
241 };
242 
243 // ===========================================================
244 // NON-MEMBER FUNCTIONS
245 // ===========================================================
246 
247 } // namespace sheaf
248 
249 #endif // ifndef ARRAY_POSET_DOF_MAP_H
char * dofs()
OBSOLETE; use dof_tuple() instead (mutable version).
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 get_dof_tuple(void *xbuf, size_t xbuflen) const =0
Copies the entire dof tuple from internal storage into xbuf.
The general, abstract map from dof ids to dof values.
Definition: poset_dof_map.h:59
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
Definition: sheaf.h:52
const char * dofs() const
OBSOLETE; use dof_tuple() instead (const version).
dof_tuple_type
Identifiers for dof tuple types.
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
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.
virtual void put_dof_tuple(const void *xbuf, size_t xbuflen)=0
Copies the entire dof tuple from xbuf into internal storage.
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.