 |
ATLAS Offline Software
|
Go to the documentation of this file.
13 #include <string_view>
21 static const int KEY_MASK = (~0
u) << CHAR_BIT;
22 static std::atomic<int> s_numCount { 0 };
30 m_classID(
Guid::null()),
31 m_oid(
OID_t(~0x0LL, ~0x0LL)),
33 s_numCount.fetch_add(1, std::memory_order_relaxed);
38 m_technology(
copy.m_technology),
40 m_classID(
copy.m_classID),
44 s_numCount.fetch_add(1, std::memory_order_relaxed);
51 m_classID(
Guid::null()),
52 m_oid(
OID_t(~0x0LL, ~0x0LL)),
57 s_numCount.fetch_add(1, std::memory_order_relaxed);
63 m_technology (
source.m_technology),
64 m_dbID (std::move (
source.m_dbID)),
65 m_cntID (std::move (
source.m_cntID)),
66 m_classID (std::move (
source.m_classID)),
67 m_oid (std::move (
source.m_oid)),
69 m_auxString (std::move (
source.m_auxString))
71 s_numCount.fetch_add(1, std::memory_order_relaxed);
76 s_numCount.fetch_sub(1, std::memory_order_relaxed);
118 else if (
m_oid.second >
copy.m_oid.second)
136 "[DB={}][CNT={}][CLID={}][TECH={:08X}][OID={:016X}-{:016X}]{}",
150 while (
pos <
src.size()) {
152 if (
start == std::string_view::npos)
break;
155 if (eq != std::string_view::npos &&
end != std::string_view::npos) {
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);
191 m_oid.first =
static_cast<long long int>(
first);
208 "[DB={}][CNT={}][CLID={}][TECH={:08X}]",
constexpr void toString(std::span< char, 36 > buf, bool uppercase=true) const noexcept
Automatic conversion to string representation.
Guid m_dbID
Database identifier.
unsigned int m_technology
Technology identifier.
virtual bool less(const Token &pTok) const
Fast token comparison: operator less.
@ u
Enums for curvilinear frames.
This class provides a token that identifies in a unique way objects on the persistent storage.
Guid m_classID
Object global identifier.
constexpr std::string_view LABEL_OID
std::string m_cntID
Container identifier.
constexpr std::string_view LABEL_TECH
Token & operator=(const Token ©)
No assignment allowed: put prototype to disable bit-wise assignment.
virtual bool equal(const Token &pTok) const
Fast token comparison: operator equals.
constexpr std::string_view LABEL_CNT
std::pair< std::vector< unsigned int >, bool > res
int release()
Release token: Decrease reference count and eventually delete.
OID_t m_oid
Persistent object identifier.
virtual const std::string toString() const
Retrieve the string representation of the token.
constexpr std::string_view LABEL_DB
Token & fromString(const std::string_view from)
Build from the string representation of a token.
constexpr std::string_view LABEL_CLID
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
virtual ~Token()
Standard destructor: release all allocated resources.
std::string m_auxString
Auxiliary string.
Token()
Standard Constructor.
static int numInstances()
expose Token instance counter for debugging
int m_refCount
Reference count.
const Token & setData(Token *pToken) const
Set all the data part of the token.
const Token & set(Token *pToken) const
Set token information.
This file contains the class definition for the Token class (migrated from POOL).
constexpr Guid & fromString(std::string_view s)
Automatic conversion from string representation.
virtual const std::string key() const
Retrieve token key.