SheafSystem  0.0.0.0
dof_descriptor_array.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 
23 
24 #ifndef DOF_DESCRIPTOR_ARRAY_H
25 #define DOF_DESCRIPTOR_ARRAY_H
26 
27 #ifndef SHEAF_DLL_SPEC_H
28 #include "SheafSystem/sheaf_dll_spec.h"
29 #endif
30 
31 #ifndef ASSERT_CONTRACT_H
32 #include "SheafSystem/assert_contract.h"
33 #endif
34 
35 #ifndef SHEAF_H
36 #include "SheafSystem/sheaf.h"
37 #endif
38 
39 #ifndef STD_IOSTREAM_H
40 #include "SheafSystem/std_iostream.h"
41 #endif
42 
43 namespace sheaf
44 {
45 
50 class SHEAF_DLL_SPEC dof_descriptor_array
51 {
52 
53 public:
54 
59  {
60  public:
61  size_t size; // size of dof
62  size_t alignment; // alignment of dof
63  int type; // primitive type index
64  size_t offset; // offset from beginning of dof tuple
65  };
66 
71 
76 
80  virtual dof_descriptor& operator[](int xid) const;
81 
85  void add_reference();
86 
90  void remove_reference();
91 
96  size_type ub() const;
97 
101  size_type dof_ct() const;
102 
106  size_type size() const;
107 
108 private:
109 
113  size_type _ref_ct;
114 
118  dof_descriptor* _descriptors;
119 
123  size_type _ub;
124 
129 
133  dof_descriptor_array(const dof_descriptor_array& xother) {};
134 
138  dof_descriptor_array& operator=(const dof_descriptor_array& xother)
139  {
140  // Must return something to keep compiler happy.
141 
142  return *this;
143  };
144 
145 };
146 
147 // ===========================================================
148 // NON-MEMBER FUNCTIONS
149 // ===========================================================
150 
154 SHEAF_DLL_SPEC
155 std::ostream& operator << (std::ostream &os, const dof_descriptor_array& p);
156 
160 SHEAF_DLL_SPEC
161 std::ostream& operator << (std::ostream &os, const dof_descriptor_array::dof_descriptor& p);
162 
166 SHEAF_DLL_SPEC
167 size_t deep_size(const dof_descriptor_array& xp, bool xinclude_shallow = true);
168 
169 } // namespace sheaf
170 
171 #endif // ifndef DOF_DESCRIPTOR_ARRAY_H
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
An array for storing structs which describe the size, alignment, and offset of dofs within a dof tupl...
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.