Template Class ObjectIdentifier¶
- Defined in File object_identifier.h
Class Documentation¶
-
template <typename T>
classObjectIdentifier
¶ The ObjectIdentifier.
The most significant 12bits store the id of the Locality where the object has been created. The remaining 48bits contain a unique number identifying the object.
- Warning
- Enforcing the previous policy is not responsibility of ObjectIdentifier but of its users.
- Template Parameters
T
: The type of the object that must be uniquely identified.
Public Functions
-
constexpr
ObjectIdentifier
(uint64_t id)¶ Constructor.
-
ObjectIdentifier
(const rt::Locality &locality, uint64_t localID)¶ Constructor.
- Parameters
locality
: The locality identifier part.localID
: The local identifier part.
-
ObjectIdentifier
(const ObjectIdentifier &oid)¶ Copy Constructor.
-
ObjectIdentifier
(ObjectIdentifier&&)¶ Move constructor.
-
ObjectIdentifier &
operator=
(ObjectIdentifier&&)¶ Move assignment.
-
ObjectIdentifier &
operator=
(const ObjectIdentifier &rhs)¶ Assignment operator.
- Parameters
rhs
: Right hand side of the operator.
-
operator uint64_t
() const¶ Conversion operator to uint64_t.
-
rt::Locality
GetOwnerLocality
() const¶ Get the Locality owing the Object.
- Return
- The Locality owing the Object.
-
size_t
GetLocalID
() const¶ Get the Local part of the ObjectIdentifier.
- Return
- The lowest ObjectIdentifier::kIdentifierBitsize bits of the ObjectID.
Public Static Attributes
-
const ObjectIdentifier<T>
kNullID
=
ObjectIdentifier<T>(std::numeric_limits<uint64_t>::max())¶ Null value for the ObjectIdentifier. This value is used during ObjectIdentifier creation when the ID can’t be known yet or the ID is invalid.
-
constexpr uint8_t
kLocalityIdBitsize
= 16u¶ The number of bits used to store the Locality where the Object is stored.
-
constexpr uint8_t
kIdentifierBitsize
= 48u¶ The number of bits in the RowID used for the row identifier in each Locality.
Friends
-
bool
operator<
(const ObjectIdentifier &lhs, const ObjectIdentifier &rhs)¶ Operator less than.
- Return
- true if lhs < rhs, false otherwise.
- Parameters
lhs
: Left hand side of the operator.rhs
: Right hand side of the operator.