20 #include "SheafSystem/standard_subposet_index.h" 22 #include "SheafSystem/assert_contract.h" 23 #include "SheafSystem/std_string.h" 29 const int STANDARD_SUBPOSET_INDEX_CT =
30 sheaf::STANDARD_SUBPOSET_INDEX_END - sheaf::STANDARD_SUBPOSET_INDEX_BEGIN;
40 (x == STANDARD_SUBPOSET_INDEX_END) ?
41 STANDARD_SUBPOSET_INDEX_BEGIN :
54 static const string names[STANDARD_SUBPOSET_INDEX_CT+1] =
57 "STANDARD_SUBPOSET_INDEX_PLACEHOLDER_MINUS_1",
61 "NOT_A_STANDARD_SUBPOSET_INDEX" 64 const string* lresult_ptr = &names[STANDARD_SUBPOSET_INDEX_CT];
69 lresult_ptr = &names[lindex - STANDARD_SUBPOSET_INDEX_BEGIN];
72 const string& result = *lresult_ptr;
76 ensure(!result.empty());
90 i< STANDARD_SUBPOSET_INDEX_END;
115 STANDARD_SUBPOSET_INDEX_PLACEHOLDER_MINUS_1,
119 NOT_A_STANDARD_SUBPOSET_INDEX
125 result = prims[xindex - STANDARD_SUBPOSET_INDEX_BEGIN];
147 (STANDARD_SUBPOSET_INDEX_BEGIN <= xindex) &&
148 (xindex < STANDARD_SUBPOSET_INDEX_END);
SHEAF_DLL_SPEC const std::string & standard_subposet_index_to_name(standard_subposet_index xpt)
The name of the enumerator xpt.
SHEAF_DLL_SPEC bool is_standard_subposet_index(pod_index_type xindex)
True if xindex is a valid primitive index.
SHEAF_DLL_SPEC standard_subposet_index standard_subposet_index_from_name(const std::string &xname)
The enumerator with name xname.
standard_subposet_index
Ids for standard subposets.
int_type pod_index_type
The plain old data index type.
SHEAF_DLL_SPEC namespace_member_index & operator++(namespace_member_index &x)
Prefix increment operator for namespace_member_index.
SHEAF_DLL_SPEC standard_subposet_index standard_subposet_index_from_index(pod_index_type xindex)
The enumerator corresponding to primitive index xindex.