21 #include "SheafSystem/namespace_member_index.h" 23 #include "SheafSystem/assert_contract.h" 24 #include "SheafSystem/std_string.h" 30 const int NAMESPACE_MEMBER_INDEX_CT =
31 sheaf::NAMESPACE_MEMBER_INDEX_END - sheaf::NAMESPACE_MEMBER_INDEX_BEGIN;
40 (x == NAMESPACE_MEMBER_INDEX_END) ?
41 NAMESPACE_MEMBER_INDEX_BEGIN :
54 static const string names[NAMESPACE_MEMBER_INDEX_CT+1] =
56 "PRIMITIVES_SCHEMA_INDEX",
57 "NAMESPACE_SCHEMA_INDEX",
59 "SCHEMA_DEFINITIONS_INDEX",
60 "NOT_A_NAMESPACE_MEMBER_INDEX" 63 const string* lresult_ptr = &names[NAMESPACE_MEMBER_INDEX_CT];
68 lresult_ptr = &names[lpt - NAMESPACE_MEMBER_INDEX_BEGIN];
71 const string& result = *lresult_ptr;
75 ensure(!result.empty());
89 i< NAMESPACE_MEMBER_INDEX_END;
113 PRIMITIVES_SCHEMA_INDEX,
114 NAMESPACE_SCHEMA_INDEX,
116 SCHEMA_DEFINITIONS_INDEX,
117 NOT_A_NAMESPACE_MEMBER_INDEX
123 result = prims[xindex - NAMESPACE_MEMBER_INDEX_BEGIN];
145 (NAMESPACE_MEMBER_INDEX_BEGIN <= xindex) && (xindex < NAMESPACE_MEMBER_INDEX_END);
SHEAF_DLL_SPEC bool is_namespace_member_index(pod_index_type xindex)
True if xindex is a valid primitive index.
SHEAF_DLL_SPEC namespace_member_index namespace_member_index_from_index(pod_index_type xindex)
The enumerator corresponding to primitive index xindex.
namespace_member_index
Ids for standard poset members.
SHEAF_DLL_SPEC namespace_member_index namespace_member_index_from_name(const std::string &xname)
The enumerator with name xname.
int_type pod_index_type
The plain old data index type.
SHEAF_DLL_SPEC const std::string & namespace_member_index_to_name(namespace_member_index xpt)
The name of the enumerator xpt.
SHEAF_DLL_SPEC namespace_member_index & operator++(namespace_member_index &x)
Prefix increment operator for namespace_member_index.