5 #include <Poco/Exception.h>
6 #include <Poco/NumberParser.h>
13 unsigned int operator() (
const SimpleID &
id)
29 SimpleID(
const SimpleID ©):
39 unsigned int hash()
const;
48 if (INT_MIN > m_value || m_value > INT_MAX)
49 throw Poco::BadCastException(
"out of range of int");
54 operator unsigned int()
const
56 if (m_value < 0 || m_value > INT_MAX)
57 throw Poco::BadCastException(
"out of range of unsigned int");
59 return (
unsigned int) m_value;
62 static SimpleID parse(
const std::string &s)
64 if (s[0] ==
'0' && s[1] ==
'x')
65 return SimpleID(Poco::NumberParser::parseHex(s));
67 return SimpleID(Poco::NumberParser::parse(s));
70 std::string toString()
const
72 return std::to_string(m_value);
75 SimpleID &operator ++()
81 SimpleID &operator ++(
int)
87 bool operator !=(
const SimpleID &
id)
const
89 return m_value !=
id.m_value;
92 bool operator ==(
const SimpleID &
id)
const
94 return m_value ==
id.m_value;
97 bool operator <(
const SimpleID &
id)
const
99 return m_value <
id.m_value;
102 bool operator >(
const SimpleID &
id)
const
104 return m_value >
id.m_value;
107 bool operator <=(
const SimpleID &
id)
const
109 return m_value <=
id.m_value;
112 bool operator >=(
const SimpleID &
id)
const
114 return m_value >=
id.m_value;
121 inline std::ostream & operator <<(std::ostream &s,
const SimpleID &
id)
123 return s <<
id.toString();
Definition: SimpleID.h:12
Definition: SimpleID.h:10