9 #ifndef STK_UTIL_UTIL_IDENTIFIER_H 10 #define STK_UTIL_UTIL_IDENTIFIER_H 13 #include <stk_util/util/ci_string.hpp> 15 #include <boost/unordered_set.hpp> 19 using ::boost::unordered_set;
28 static int compare(
const char *s1,
const size_t s1_length,
const char *s2,
const size_t s2_length);
33 IdentifierA(
const IdentifierA &identifier)
34 : m_string(identifier.m_string)
37 explicit IdentifierA(
const std::string &
string)
41 explicit IdentifierA(
const char *
string)
45 IdentifierA &operator=(
const IdentifierA &identifier) {
46 if (&identifier !=
this)
47 m_string = identifier.m_string;
51 IdentifierA &operator=(
const std::string &
string) {
56 IdentifierA &operator+=(
const IdentifierA &identifier) {
57 m_string.append(identifier.m_string);
61 IdentifierA &operator+=(
const std::string &
string) {
62 m_string.append(
string);
66 const char *c_str()
const {
67 return m_string.c_str();
70 const size_t length()
const {
71 return m_string.length();
74 operator const std::string &()
const {
83 IdentifierA operator+(
const IdentifierA &identifier1,
const IdentifierA &identifier2);
85 IdentifierA operator+(
const IdentifierA &identifier1,
const std::string &string2);
87 std::string operator+(
const std::string &string1,
const IdentifierA &identifier2);
89 std::ostream &
operator<<(std::ostream &os,
const IdentifierA &identifier);
91 std::istream &operator>>(std::istream &is, IdentifierA &identifier);
93 bool operator<(
const std::string &s1,
const IdentifierA &s2);
95 bool operator<(
const IdentifierA &s1,
const std::string &s2);
97 bool operator<(
const IdentifierA &s1,
const IdentifierA &s2);
99 bool operator<(
const IdentifierA &s1,
const char *s2);
101 bool operator==(
const std::string &s1,
const IdentifierA &s2);
103 bool operator==(
const IdentifierA &s1,
const std::string &s2);
105 bool operator==(
const IdentifierA &s1,
const IdentifierA &s2);
107 bool operator==(
const IdentifierA &s1,
const char *s2);
109 bool operator<=(
const std::string &s1,
const IdentifierA &s2);
111 bool operator<=(
const IdentifierA &s1,
const std::string &s2);
113 bool operator<=(
const IdentifierA &s1,
const IdentifierA &s2);
115 bool operator<=(
const IdentifierA &s1,
const char *s2);
117 bool operator>(
const std::string &s1,
const IdentifierA &s2);
119 bool operator>(
const IdentifierA &s1,
const std::string &s2);
121 bool operator>(
const IdentifierA &s1,
const IdentifierA &s2);
123 bool operator>(
const IdentifierA &s1,
const char *s2);
125 bool operator>=(
const std::string &s1,
const IdentifierA &s2);
127 bool operator>=(
const IdentifierA &s1,
const std::string &s2);
129 bool operator>=(
const IdentifierA &s1,
const IdentifierA &s2);
131 bool operator>=(
const IdentifierA &s1,
const char *s2);
133 bool operator!=(
const std::string &s1,
const IdentifierA &s2);
135 bool operator!=(
const IdentifierA &s1,
const std::string &s2);
137 bool operator!=(
const IdentifierA &s1,
const IdentifierA &s2);
139 bool operator!=(
const IdentifierA &s1,
const char *s2);
144 class IdentifierB :
public std::string
147 static int compare(
const char *s1,
const size_t s1_length,
const char *s2,
const size_t s2_length);
152 IdentifierB(
const IdentifierB &identifier)
156 explicit IdentifierB(
const std::string &
string)
160 explicit IdentifierB(
const char *
string)
164 IdentifierB &operator=(
const IdentifierB &identifier) {
165 std::string::operator=(identifier);
169 IdentifierB &operator=(
const std::string &
string) {
170 std::string::operator=(
string);
174 IdentifierB &operator=(
const char *
string) {
175 std::string::operator=(
string);
180 IdentifierB operator+(
const IdentifierB &identifier1,
const IdentifierB &identifier2);
182 IdentifierB operator+(
const IdentifierB &identifier1,
const std::string &string2);
184 IdentifierB operator+(
const IdentifierB &identifier1,
const char *string2);
186 std::string operator+(
const std::string &string1,
const IdentifierB &identifier2);
188 std::ostream &
operator<<(std::ostream &os,
const IdentifierB &identifier);
190 std::istream &operator>>(std::istream &is, IdentifierB &identifier);
192 bool operator<(
const std::string &s1,
const IdentifierB &s2);
194 bool operator<(
const IdentifierB &s1,
const std::string &s2);
196 bool operator<(
const IdentifierB &s1,
const IdentifierB &s2);
198 bool operator<(
const IdentifierB &s1,
const char *s2);
200 bool operator==(
const std::string &s1,
const IdentifierB &s2);
202 bool operator==(
const IdentifierB &s1,
const std::string &s2);
204 bool operator==(
const IdentifierB &s1,
const IdentifierB &s2);
206 bool operator==(
const IdentifierB &s1,
const char *s2);
208 bool operator<=(
const std::string &s1,
const IdentifierB &s2);
210 bool operator<=(
const IdentifierB &s1,
const std::string &s2);
212 bool operator<=(
const IdentifierB &s1,
const IdentifierB &s2);
214 bool operator<=(
const IdentifierB &s1,
const char *s2);
216 bool operator>(
const std::string &s1,
const IdentifierB &s2);
218 bool operator>(
const IdentifierB &s1,
const std::string &s2);
220 bool operator>(
const IdentifierB &s1,
const IdentifierB &s2);
222 bool operator>(
const IdentifierB &s1,
const char *s2);
224 bool operator>=(
const std::string &s1,
const IdentifierB &s2);
226 bool operator>=(
const IdentifierB &s1,
const std::string &s2);
228 bool operator>=(
const IdentifierB &s1,
const IdentifierB &s2);
230 bool operator>=(
const IdentifierB &s1,
const char *s2);
232 bool operator!=(
const std::string &s1,
const IdentifierB &s2);
234 bool operator!=(
const IdentifierB &s1,
const std::string &s2);
236 bool operator!=(
const IdentifierB &s1,
const IdentifierB &s2);
238 bool operator!=(
const IdentifierB &s1,
const char *s2);
247 std::size_t operator()(
const stk_classic::IdentifierA &s)
const;
253 std::size_t operator()(
const stk_classic::IdentifierB &s)
const;
258 #endif // STK_UTIL_UTIL_IDENTIFIER_H
std::ostream & operator<<(std::ostream &s, const Bucket &k)
Print the part names for which this bucket is a subset.
basic_string< char > string
string / wstring