33 s_numCount.fetch_add(1, std::memory_order_relaxed);
44 s_numCount.fetch_add(1, std::memory_order_relaxed);
55 source->setData(
this);
57 s_numCount.fetch_add(1, std::memory_order_relaxed);
64 m_dbID (std::move (source.m_dbID)),
65 m_cntID (std::move (source.m_cntID)),
67 m_oid (std::move (source.m_oid)),
71 s_numCount.fetch_add(1, std::memory_order_relaxed);
76 s_numCount.fetch_sub(1, std::memory_order_relaxed);
99 if (
m_oid.second == copy.m_oid.second) {
101 if (
m_dbID == copy.m_dbID) {
116 if (
m_oid.second < copy.m_oid.second)
118 else if (
m_oid.second > copy.m_oid.second)
123 if (!(
m_dbID == copy.m_dbID)) {
124 return (
m_dbID < copy.m_dbID);
136 "[DB={}][CNT={}][CLID={}][TECH={:08X}][OID={:016X}-{:016X}]{}",
141 static_cast<uint64_t
>(
m_oid.first),
142 static_cast<uint64_t
>(
m_oid.second),
150 while (pos < src.size()) {
151 size_t start = src.find(
'[', pos);
152 if (start == std::string_view::npos)
break;
153 size_t eq = src.find(
'=', start);
154 size_t end = src.find(
']', start);
155 if (eq != std::string_view::npos && end != std::string_view::npos) {
156 std::string_view
label = src.substr(start, eq - start + 1);
158 m_dbID.fromString(src.substr(eq + 1, end - eq - 1));
160 m_cntID = std::string(src.substr(eq + 1, end - eq - 1));
162 m_classID.fromString(src.substr(eq + 1, end - eq - 1));
164 std::string_view num_str = src.substr(eq + 1, end - eq - 1);
166 std::from_chars(num_str.data(), num_str.data() + num_str.size(), tech, 16);
169 std::string_view oid_str = src.substr(eq + 1, end - eq - 1);
170 size_t dash = oid_str.find(
'-');
171 if (dash != std::string_view::npos) {
172 std::string_view first_str = oid_str.substr(0, dash);
173 std::string_view second_str = oid_str.substr(dash + 1);
178 bool is_legacy = (end - start + 1) == 23;
182 std::from_chars(first_str.data(), first_str.data() + first_str.size(), first, 16);
183 std::from_chars(second_str.data(), second_str.data() + second_str.size(), second, 16);
187 if (
static_cast<uint32_t
>(first) == ~0x0U) first = ~0x0ULL;
188 if (
static_cast<uint32_t
>(second) == ~0x0U) second = ~0x0ULL;
191 m_oid.first =
static_cast<long long int>(first);
192 m_oid.second =
static_cast<long long int>(second);
208 "[DB={}][CNT={}][CLID={}][TECH={:08X}]",
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).
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)