34 s_numCount.fetch_add(1, std::memory_order_relaxed);
45 s_numCount.fetch_add(1, std::memory_order_relaxed);
56 source->setData(
this);
58 s_numCount.fetch_add(1, std::memory_order_relaxed);
65 m_dbID (std::move (source.m_dbID)),
66 m_cntID (std::move (source.m_cntID)),
68 m_oid (std::move (source.m_oid)),
72 s_numCount.fetch_add(1, std::memory_order_relaxed);
77 s_numCount.fetch_sub(1, std::memory_order_relaxed);
100 if (
m_oid.second == copy.m_oid.second) {
102 if (
m_dbID == copy.m_dbID) {
117 if (
m_oid.second < copy.m_oid.second)
119 else if (
m_oid.second > copy.m_oid.second)
124 if (!(
m_dbID == copy.m_dbID)) {
125 return (
m_dbID < copy.m_dbID);
144 res.reserve(4 + 36 + 6 +
m_cntID.size() + 7 + 36 + 1 +
148 size_t pos =
res.size();
149 res.resize(pos + 36);
150 m_dbID.toString(std::span<char, 36>(
res.data() + pos, 36));
157 res.resize(pos + 36);
158 m_classID.toString(std::span<char, 36>(
res.data() + pos, 36));
161 res +=
static_cast<std::string_view
>(techHex);
162 res +=
static_cast<std::string_view
>(oid1Hex);
163 res +=
static_cast<std::string_view
>(oid2Hex);
172 while (pos < src.size()) {
173 size_t start = src.find(
'[', pos);
174 if (start == std::string_view::npos)
break;
175 size_t eq = src.find(
'=', start);
176 size_t end = src.find(
']', start);
177 if (eq != std::string_view::npos && end != std::string_view::npos) {
178 std::string_view
label = src.substr(start, eq - start + 1);
180 m_dbID.fromString(src.substr(eq + 1, end - eq - 1));
182 m_cntID = std::string(src.substr(eq + 1, end - eq - 1));
184 m_classID.fromString(src.substr(eq + 1, end - eq - 1));
186 std::string_view num_str = src.substr(eq + 1, end - eq - 1);
188 std::from_chars(num_str.data(), num_str.data() + num_str.size(), tech, 16);
191 std::string_view oid_str = src.substr(eq + 1, end - eq - 1);
192 size_t dash = oid_str.find(
'-');
193 if (dash != std::string_view::npos) {
194 std::string_view first_str = oid_str.substr(0, dash);
195 std::string_view second_str = oid_str.substr(dash + 1);
200 bool is_legacy = (end - start + 1) == 23;
204 std::from_chars(first_str.data(), first_str.data() + first_str.size(), first, 16);
205 std::from_chars(second_str.data(), second_str.data() + second_str.size(), second, 16);
209 if (
static_cast<uint32_t
>(first) == ~0x0U) first = ~0x0ULL;
210 if (
static_cast<uint32_t
>(second) == ~0x0U) second = ~0x0ULL;
213 m_oid.first =
static_cast<long long int>(first);
214 m_oid.second =
static_cast<long long int>(second);
235 res.reserve(4 + 36 + 6 +
m_cntID.size() + 7 + 36 + 1 + techHex.
size());
238 size_t pos =
res.size();
239 res.resize(pos + 36);
240 m_dbID.toString(std::span<char, 36>(
res.data() + pos, 36));
247 res.resize(pos + 36);
248 m_classID.toString(std::span<char, 36>(
res.data() + pos, 36));
251 res +=
static_cast<std::string_view
>(techHex);
Provides a utility class to format integral types as hexadecimal strings at compile time or with VERY...
std::pair< std::vector< unsigned int >, bool > res
constexpr std::string_view LABEL_DB
constexpr std::string_view LABEL_TECH
static std::atomic< int > s_numCount
constexpr std::string_view LABEL_CLID
constexpr std::string_view LABEL_CNT
constexpr std::string_view LABEL_OID
static const int KEY_MASK
This file contains the class definition for the Token class (migrated from POOL).
A class that formats an integer as a hexadecimal string embedded within a format string.
constexpr std::size_t size() const noexcept
Returns the total size of the formatted string.
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
int m_refCount
Reference count.
const Token & setData(Token *pToken) const
Set all the data part of the token.
virtual ~Token()
Standard destructor: release all allocated resources.
Guid m_classID
Object global identifier.
unsigned int m_technology
Technology identifier.
Token(const Token ©)
No copy allowed: put prototype to disable bit-wise copy.
virtual const std::string toString() const
Retrieve the string representation of the token.
OID_t m_oid
Persistent object identifier.
virtual bool less(const Token &pTok) const
Fast token comparison: operator less.
virtual bool equal(const Token &pTok) const
Fast token comparison: operator equals.
Token()
Standard Constructor.
int release()
Release token: Decrease reference count and eventually delete.
Token & operator=(const Token ©)
No assignment allowed: put prototype to disable bit-wise assignment.
static int numInstances()
expose Token instance counter for debugging
std::string m_auxString
Auxiliary string.
std::string m_cntID
Container identifier.
virtual const std::string key() const
Retrieve token key.
Token & fromString(const std::string_view from)
Build from the string representation of a token.
const Token & set(Token *pToken) const
Set token information.
Guid m_dbID
Database identifier.
std::string label(const std::string &format, int i)