SheafSystem  0.0.0.0
abstract_poset_member.impl.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 
22 #ifndef ABSTRACT_POSET_MEMBER_IMPL_H
23 #define ABSTRACT_POSET_MEMBER_IMPL_H
24 
25 #ifndef SHEAF_DLL_SPEC_H
26 #include "SheafSystem/sheaf_dll_spec.h"
27 #endif
28 
29 #ifndef ABSTRACT_POSET_MEMBER_H
30 #include "SheafSystem/abstract_poset_member.h"
31 #endif
32 
33 namespace sheaf
34 {
35 
36 // ===========================================================
37 // NONMEMBER FUNCTIONS
38 // ===========================================================
39 
40 template <typename T>
41 typename T::table_dofs_type&
42 table_dofs(T& x0)
43 {
44  // Preconditions:
45 
46  require(precondition_of(x0.table_dofs()));
47 
48  // Body:
49 
50  typename T::table_dofs_type& result =
51  *reinterpret_cast<typename T::table_dofs_type*>(x0.table_dofs());
52 
53  // Postconditions:
54 
55  ensure(postcondition_of(x0.table_dofs()));
56 
57  // Exit:
58 
59  return result;
60 };
61 
62 template <typename T>
63 const typename T::table_dofs_type&
64 table_dofs(const T& x0)
65 {
66  // Preconditions:
67 
68  require(precondition_of(x0.table_dofs()));
69 
70  // Body:
71 
72  const typename T::table_dofs_type& result =
73  *reinterpret_cast<const typename T::table_dofs_type*>(x0.table_dofs());
74 
75  // Postconditions:
76 
77  ensure(postcondition_of(x0.table_dofs()));
78 
79  // Exit:
80 
81  return result;
82 };
83 
84 template <typename T>
85 typename T::table_dofs_type&
86 table_dofs(T& x0, bool xauto_access)
87 {
88  // Preconditions:
89 
90  require(precondition_of(x0.table_dofs(xauto_access)));
91 
92  // Body:
93 
94  typename T::table_dofs_type& result =
95  *reinterpret_cast<typename T::table_dofs_type*>(x0.table_dofs(xauto_access));
96 
97  // Postconditions:
98 
99  ensure(postcondition_of(x0.table_dofs(xauto_access)));
100 
101  // Exit:
102 
103  return result;
104 };
105 
106 template <typename T>
107 const typename T::table_dofs_type&
108 table_dofs(const T& x0, bool xauto_access)
109 {
110  // Preconditions:
111 
112  require(precondition_of(x0.table_dofs(xauto_access)));
113 
114  // Body:
115 
116  const typename T::table_dofs_type& result =
117  *reinterpret_cast<const typename T::table_dofs_type*>(x0.table_dofs(xauto_access));
118 
119  // Postconditions:
120 
121  ensure(postcondition_of(x0.table_dofs(xauto_access)));
122 
123  // Exit:
124 
125  return result;
126 };
127 
128 template <typename T>
129 typename T::row_dofs_type&
130 row_dofs(T& x0)
131 {
132  // Preconditions:
133 
134  require(precondition_of(x0.row_dofs()));
135 
136  // Body:
137 
138  typename T::row_dofs_type& result =
139  *reinterpret_cast<typename T::row_dofs_type*>(x0.row_dofs());
140 
141  // Postconditions:
142 
143  ensure(postcondition_of(x0.row_dofs()));
144 
145  // Exit:
146 
147  return result;
148 };
149 
150 template <typename T>
151 const typename T::row_dofs_type&
152 row_dofs(const T& x0)
153 {
154  // Preconditions:
155 
156  require(precondition_of(x0.row_dofs()));
157 
158  // Body:
159 
160  const typename T::row_dofs_type& result =
161  *reinterpret_cast<const typename T::row_dofs_type*>(x0.row_dofs());
162 
163  // Postconditions:
164 
165  ensure(postcondition_of(x0.row_dofs()));
166 
167  // Exit:
168 
169  return result;
170 };
171 
172 template <typename T>
173 typename T::row_dofs_type&
174 row_dofs(T& x0, bool xauto_access)
175 {
176  // Preconditions:
177 
178  require(precondition_of(x0.row_dofs(xauto_access)));
179 
180  // Body:
181 
182  typename T::row_dofs_type& result =
183  *reinterpret_cast<typename T::row_dofs_type*>(x0.row_dofs(xauto_access));
184 
185  // Postconditions:
186 
187  ensure(postcondition_of(x0.row_dofs(xauto_access)));
188 
189  // Exit:
190 
191  return result;
192 };
193 
194 template <typename T>
195 const typename T::row_dofs_type&
196 row_dofs(const T& x0, bool xauto_access)
197 {
198  // Preconditions:
199 
200  require(precondition_of(x0.row_dofs(xauto_access)));
201 
202  // Body:
203 
204  const typename T::row_dofs_type& result =
205  *reinterpret_cast<const typename T::row_dofs_type*>(x0.row_dofs(xauto_access));
206 
207  // Postconditions:
208 
209  ensure(postcondition_of(x0.row_dofs(xauto_access)));
210 
211  // Exit:
212 
213  return result;
214 };
215 
216 } // namespace sheaf
217 
218 #endif // ifndef ABSTRACT_POSET_MEMBER_IMPL_H
T::row_dofs_type & row_dofs(T &x0)
The row dofs pod type for x0 (mutable version).
T::table_dofs_type & table_dofs(T &x0)
The table dofs pod type for x0 (mutable version).
Namespace for the sheaves component of the sheaf system.