SheafSystem  0.0.0.0
poset_type.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 poset type id facet of namespace sheaf.
19 
20 #include "SheafSystem/poset_type.h"
21 
22 #include "SheafSystem/assert_contract.h"
23 #include "SheafSystem/error_message.h"
24 
25 // =============================================================================
26 // POSET TYPE FACET
27 // =============================================================================
28 
31 sheaf::
33 {
34  poset_type result;
35 
36  // Preconditions:
37 
38  // Body:
39 
40  // Array needed only to convert type
41  // from int to enum.
42 
43  static const poset_type ltype_ids[] =
44  {
45  NAMESPACE_POSET_ID,
46  PRIMITIVES_POSET_ID,
47  PRIMITIVES_POSET_SCHEMA_ID,
48  NAMESPACE_POSET_SCHEMA_ID,
49  POSET_ID,
50  REFINABLE_POSET_ID,
51  SHEAVES_NAMESPACE_ID,
52  FIBER_BUNDLES_NAMESPACE_ID,
53  BASE_SPACE_POSET_ID,
54  TUPLE_SPACE_ID,
55  VD_SPACE_ID,
56  TP_SPACE_ID,
57  STP_SPACE_ID,
58  ATP_SPACE_ID,
59  AT1_SPACE_ID,
60  AT0_SPACE_ID,
61  GLN_SPACE_ID,
62  JCB_SPACE_ID,
63  SEC_REP_DESCRIPTOR_POSET_ID,
64  SEC_REP_SPACE_ID,
65  SEC_TUPLE_SPACE_ID,
66  SEC_VD_SPACE_ID,
67  SEC_TP_SPACE_ID,
68  SEC_STP_SPACE_ID,
69  SEC_ATP_SPACE_ID,
70  SEC_AT1_SPACE_ID,
71  SEC_AT0_SPACE_ID,
72  SEC_JCB_SPACE_ID,
73  SECTION_SPACE_SCHEMA_POSET_ID,
74  BINARY_SECTION_SPACE_SCHEMA_POSET_ID,
75  PRODUCT_SECTION_SPACE_SCHEMA_POSET_ID,
76  NOT_A_POSET_TYPE // must be last
77  }
78  ;
79 
80  if((0 <= xi) && (xi < NOT_A_POSET_TYPE))
81  {
82  result = ltype_ids[xi];
83  }
84  else
85  {
86  result = NOT_A_POSET_TYPE;
87  }
88 
89  // Postconditions:
90 
91  // Exit
92 
93  return result;
94 }
95 
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
poset_type
Identifiers for poset types.
Definition: poset_type.h:41