SheafSystem  0.0.0.0
sheaf_constants.cc
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 // Definitions for class sheaf_constants
19 
20 #include "SheafSystem/sheaf_constants.h"
21 
22 // =============================================================================
23 // POSET TYPES FACET
24 // =============================================================================
25 
29 {
30  return sheaf::poset_type_id(xi);
31 }
32 
33 // =============================================================================
34 // DOF TUPLE TYPES FACET
35 // =============================================================================
36 
37 const string&
40 {
42 }
43 
46 dof_tuple_type_from_name(const string& xname)
47 {
48  return sheaf::dof_tuple_type_from_name(xname);
49 }
50 
54 {
55  return sheaf::dof_tuple_type_id(xi);
56 }
57 
58 
59 
60 // =============================================================================
61 // VERSION IDENTIFIERS FACET
62 // =============================================================================
63 
64 
66 const int
69 {
70  return -1;
71 }
72 
74 const int
77 {
78  return -2;
79 }
80 
82 const int
85 {
86  return -3;
87 }
88 
90 const int
93 {
94  return -4;
95 }
96 
97 
98 // =============================================================================
99 // STANDARD POSET MEMBERS FACET
100 // =============================================================================
101 
103 const scoped_index
106 {
107  static const scoped_index result(0);
108  return result;
109 }
110 
112 const scoped_index
115 {
116  static const scoped_index result(1);
117  return result;
118 }
119 
120 
121 // =============================================================================
122 // STANDARD NAMESPACE_POSET MEMBERS FACET
123 // =============================================================================
124 
126 const scoped_index
129 {
130  static const scoped_index result(2);
131  return result;
132 }
133 
135 const scoped_index
138 {
139  static const scoped_index result(3);
140  return result;
141 }
142 
144 const scoped_index
147 {
148  static const scoped_index result(4);
149  return result;
150 }
151 
153 const scoped_index
156 {
157  static const scoped_index result(5);
158  return result;
159 }
160 
161 
162 
163 // =============================================================================
164 // STANDARD SUBPOSETS FACET
165 // =============================================================================
166 
168 const scoped_index
171 {
172  static const scoped_index result(0);
173  return result;
174 }
175 
177 const scoped_index
180 {
181  static const scoped_index result(1);
182  return result;
183 }
184 
186 const scoped_index
189 {
190  static const scoped_index result(2);
191  return result;
192 }
193 
195 const scoped_index
198 {
199  static const scoped_index result(-2);
200  return result;
201 }
202 
203 
204 
205 // =============================================================================
206 // STANDARD DOF TUPLES FACET
207 // =============================================================================
208 
210 const scoped_index
213 {
214  static const scoped_index result(0);
215  return result;
216 }
217 
218 
219 // =============================================================================
220 // PRIMITIVE TYPES FACET
221 // =============================================================================
222 
223 string
226 {
227  return primitive_attributes::name(xpt);
228 }
229 
232 primitive_type_from_name(const string& xname)
233 {
234  return primitive_attributes::id(xname);
235 }
236 
240 {
241  return primitive_attributes::id(xindex);
242 }
243 
244 bool
247 {
248  return sheaf::is_primitive_index(xindex);
249 }
250 
251 // =============================================================================
252 // PRIMITIVE DESCRIPTORS FACET
253 // =============================================================================
254 
255 sheaf::sheaf_constants::primitive_descriptor
258 {
259  return primitive_description(xindex);
260 }
261 
262 size_t
265 {
266  return sizeof(primitive_buffer_type);
267 }
268 
269 size_t
271 align(const size_t xoffset, const size_t xalignment)
272 {
273  return sheaf::align(xoffset, xalignment);
274 }
275 
276 
277 
278 // ===========================================================
279 // UTILITY FUNCTIONS
280 // ===========================================================
281 
282 void
285 {
287 }
288 
289 
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
static const scoped_index WHOLE_INDEX()
The index of the whole subposet; the top of the powerset of a poset.
static const scoped_index RESIDENT_INDEX()
The index of the resident subposet of a poset.
static size_t max_primitive_size()
The size of the largest primitive.
static primitive_type primitive_type_from_index(int xindex)
The enumerator corresponding to primitive index xindex.
SHEAF_DLL_SPEC void check_lps_script_has_run()
Function to test for whether the LPS script has been executed.
Definition: sheaf.cc:36
static poset_type poset_type_id(int xi)
The poset type associated with int xi; converts int to poset type.
static primitive_type primitive_type_from_name(const string &xname)
The enumerator with name xname.
static size_t align(const size_t xoffset, const size_t xalignment)
Smallest offset greater than or equal to xoffset that has alignment xalignment.
static const int CURRENT_HOST_VERSION()
An alias for the current version of a poset.
static const scoped_index TOP_INDEX()
The index of the top member of a poset.
SHEAF_DLL_SPEC dof_tuple_type dof_tuple_type_from_name(const std::string &xname)
The enumerator with name xname.
static const string & dof_tuple_type_to_name(dof_tuple_type xdt)
The name of the enumerator xdt.
static dof_tuple_type dof_tuple_type_id(int xi)
The dof tuple type associated with int xi; converts int to dof tuple type.
static const int NOT_A_VERSION()
The void version.
primitive_type primitive_type
Type ids for primitives.
static const scoped_index EMPTY_DOF_TUPLE_INDEX()
The index of the (unique) empty dof map, i.e. the dof map with dof_ct() == 0.
static string primitive_type_to_name(primitive_type xpt)
The name of the enumerator xpt.
dof_tuple_type dof_tuple_type
Identifiers for dof tuple types.
static const scoped_index TOC_INDEX()
Alias for the table of contents subposet.
static const scoped_index NAMESPACE_SCHEMA_INDEX()
Index of namespace schema poset.
poset_type poset_type
Identifiers for poset types.
Type of buffer large enough to hold any primitive type.
static const int COARSEST_COMMON_REFINEMENT_VERSION()
The version of the coarsest common refinement of all other versions.
SHEAF_DLL_SPEC const std::string & dof_tuple_type_to_name(dof_tuple_type xdt)
The name of the enumerator xdt.
An index within the external ("client") scope of a given id space.
Definition: scoped_index.h:116
static void check_lps_script_has_run()
Function to test for whether the LPS script has been executed.
static dof_tuple_type dof_tuple_type_from_name(const string &xname)
The enumerator with name xname.
static const scoped_index JIMS_INDEX()
The index of the jims subposet of a poset.
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
static const scoped_index PRIMITIVES_SCHEMA_INDEX()
Index of primitives schema poset.
SHEAF_DLL_SPEC dof_tuple_type dof_tuple_type_id(int xi)
The dof tuple type associated with int xi; converts int to dof tuple type.
static const int CURRENT_MEMBER_VERSION()
An alias for the current version of a member.
static const scoped_index BOTTOM_INDEX()
The index of the bottom member of a poset.
static primitive_descriptor primitive_description(int xindex)
A descriptor for the primitive with index xindex.
primitive_type id() const
The id for the primitive type associated with this.
size_t align(const size_t xoffset, const size_t xalignment)
Smallest offset greater than or equal to xoffset that has alignment xalignment.
static bool is_primitive_index(int xindex)
True if xindex is a valid primitive index.
static const scoped_index SCHEMA_DEFINITIONS_INDEX()
Index of schema definitions jrm.
static const scoped_index PRIMITIVES_INDEX()
Index of primitives poset.
const std::string & name() const
The name of the primitive type associated with this.