SheafSystem  0.0.0.0
sheaf_constants.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 // Declarations for namespace sheaf_constants
19 
20 #ifndef SHEAF_CONSTANTS_H
21 #define SHEAF_CONSTANTS_H
22 
23 #ifndef SHEAF_DLL_SPEC_H
24 #include "SheafSystem/sheaf_dll_spec.h"
25 #endif
26 
27 #ifndef DOF_TUPLE_TYPE_H
28 #include "SheafSystem/dof_tuple_type.h"
29 #endif
30 
31 #ifndef POSET_TYPE_H
32 #include "SheafSystem/poset_type.h"
33 #endif
34 
35 #ifndef PRIMITIVE_TYPE_H
36 #include "SheafSystem/primitive_type.h"
37 #endif
38 
39 #ifndef SCOPED_INDEX_H
40 #include "SheafSystem/scoped_index.h"
41 #endif
42 
43 #ifndef STANDARD_VERSION_INDEX_H
44 #include "SheafSystem/standard_version_index.h"
45 #endif
46 
47 #ifndef STD_CSTDDEF_H
48 #include "SheafSystem/std_cstddef.h"
49 #endif
50 
51 #ifndef STD_IOSTREAM_H
52 #include "SheafSystem/std_iostream.h"
53 #endif
54 
55 #ifndef STD_STRING_H
56 #include "SheafSystem/std_string.h"
57 #endif
58 
59 namespace sheaf
60 {
61 
68 class SHEAF_DLL_SPEC sheaf_constants
69 {
70 
71 public:
72 
73  // =============================================================================
74  // POSET TYPES FACET
75  // =============================================================================
76 
81 
86  static poset_type poset_type_id(int xi);
87 
88  // =============================================================================
89  // DOF TUPLE TYPES FACET
90  // =============================================================================
91 
96 
100  static const string& dof_tuple_type_to_name(dof_tuple_type xdt);
101 
105  static dof_tuple_type dof_tuple_type_from_name(const string& xname);
106 
111  static dof_tuple_type dof_tuple_type_id(int xi);
112 
113  // =============================================================================
114  // VERSION IDENTIFIERS FACET
115  // =============================================================================
116 
120  static const int NOT_A_VERSION();
121 
126  static const int COARSEST_COMMON_REFINEMENT_VERSION();
127 
131  static const int CURRENT_HOST_VERSION();
132 
136  static const int CURRENT_MEMBER_VERSION();
137 
138  // =============================================================================
139  // STANDARD POSET MEMBERS FACET
140  // =============================================================================
141 
145  static const scoped_index BOTTOM_INDEX();
146 
150  static const scoped_index TOP_INDEX();
151 
152  // =============================================================================
153  // STANDARD NAMESPACE_POSET MEMBERS FACET
154  // =============================================================================
155 
159  static const scoped_index PRIMITIVES_SCHEMA_INDEX();
160 
164  static const scoped_index NAMESPACE_SCHEMA_INDEX();
165 
169  static const scoped_index PRIMITIVES_INDEX();
170 
174  static const scoped_index SCHEMA_DEFINITIONS_INDEX();
175 
176  // =============================================================================
177  // STANDARD SUBPOSETS FACET
178  // =============================================================================
179 
183  static const scoped_index JIMS_INDEX();
184 
188  static const scoped_index WHOLE_INDEX();
189 
193  static const scoped_index RESIDENT_INDEX();
197  static const scoped_index TOC_INDEX();
198 
199  // =============================================================================
200  // STANDARD DOF TUPLES FACET
201  // =============================================================================
202 
216  static const scoped_index EMPTY_DOF_TUPLE_INDEX();
217 
219 
220 
221  // =============================================================================
222  // PRIMITIVE TYPES FACET
223  // =============================================================================
224 
229 
233  static string primitive_type_to_name(primitive_type xpt);
234 
238  static primitive_type primitive_type_from_name(const string& xname);
239 
243  static primitive_type primitive_type_from_index(int xindex);
244 
248  static bool is_primitive_index(int xindex);
249 
250  // =============================================================================
251  // PRIMITIVE DESCRIPTORS FACET
252  // =============================================================================
253 
254  typedef primitive_descriptor primitive_descriptor;
255 
259  static primitive_descriptor primitive_description(int xindex);
260 
264  static size_t max_primitive_size();
265 
269  static size_t align(const size_t xoffset, const size_t xalignment);
270 
271  // =============================================================================
272  // UTILITY METHODS FACET
273  // =============================================================================
274 
282  static void check_lps_script_has_run();
283 
284 };
285 
286 } // namespace sheaf
287 
288 
289 #endif // ifndef SHEAF_CONSTANTS_H
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
SHEAF_DLL_SPEC void check_lps_script_has_run()
Function to test for whether the LPS script has been executed.
Definition: sheaf.cc:36
SHEAF_DLL_SPEC dof_tuple_type dof_tuple_type_from_name(const std::string &xname)
The enumerator with name xname.
primitive_type primitive_type
Type ids for primitives.
dof_tuple_type dof_tuple_type
Identifiers for dof tuple types.
poset_type poset_type
Identifiers for poset types.
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
OBSOLETE: use sheaf::poset_type, sheaf::dof_tuple_type, etc. Retained only because swig wraps only cl...
SHEAF_DLL_SPEC bool is_primitive_index(pod_index_type xindex)
True if xindex is a valid primitive index.
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.
size_t align(const size_t xoffset, const size_t xalignment)
Smallest offset greater than or equal to xoffset that has alignment xalignment.
Namespace for the sheaves component of the sheaf system.