rippled
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
ripple::IntrusiveRefCounts::RefCountPair Struct Reference

Unpack the count and tag fields from the packed atomic integer form. More...

Collaboration diagram for ripple::IntrusiveRefCounts::RefCountPair:
Collaboration graph
[legend]

Public Member Functions

 RefCountPair (FieldType v) noexcept
 
 RefCountPair (CountType s, CountType w) noexcept
 
FieldType combinedValue () const noexcept
 Convert back to the packed integer form.
 

Public Attributes

CountType strong
 
CountType weak
 
FieldType partialDestroyStartedBit {0}
 The partialDestroyStartedBit is set to on when the partial destroy function is started.
 
FieldType partialDestroyFinishedBit {0}
 The partialDestroyFinishedBit is set to on when the partial destroy function has finished.
 

Static Public Attributes

static constexpr CountType maxStrongValue
 
static constexpr CountType maxWeakValue
 
static constexpr CountType checkStrongMaxValue = maxStrongValue - 32
 Put an extra margin to detect when running up against limits.
 
static constexpr CountType checkWeakMaxValue = maxWeakValue - 32
 

Detailed Description

Unpack the count and tag fields from the packed atomic integer form.

Definition at line 196 of file IntrusiveRefCounts.h.

Constructor & Destructor Documentation

◆ RefCountPair() [1/2]

ripple::IntrusiveRefCounts::RefCountPair::RefCountPair ( IntrusiveRefCounts::FieldType  v)
noexcept

Definition at line 421 of file IntrusiveRefCounts.h.

◆ RefCountPair() [2/2]

ripple::IntrusiveRefCounts::RefCountPair::RefCountPair ( IntrusiveRefCounts::CountType  s,
IntrusiveRefCounts::CountType  w 
)
noexcept

Definition at line 434 of file IntrusiveRefCounts.h.

Member Function Documentation

◆ combinedValue()

IntrusiveRefCounts::FieldType ripple::IntrusiveRefCounts::RefCountPair::combinedValue ( ) const
noexcept

Convert back to the packed integer form.

Definition at line 446 of file IntrusiveRefCounts.h.

Member Data Documentation

◆ strong

CountType ripple::IntrusiveRefCounts::RefCountPair::strong

Definition at line 198 of file IntrusiveRefCounts.h.

◆ weak

CountType ripple::IntrusiveRefCounts::RefCountPair::weak

Definition at line 199 of file IntrusiveRefCounts.h.

◆ partialDestroyStartedBit

FieldType ripple::IntrusiveRefCounts::RefCountPair::partialDestroyStartedBit {0}

The partialDestroyStartedBit is set to on when the partial destroy function is started.

It is not a boolean; it is a uint32 with all bits zero with the possible exception of the partialDestroyStartedMask bit. This is done so it can be directly masked into the combinedValue.

Definition at line 206 of file IntrusiveRefCounts.h.

◆ partialDestroyFinishedBit

FieldType ripple::IntrusiveRefCounts::RefCountPair::partialDestroyFinishedBit {0}

The partialDestroyFinishedBit is set to on when the partial destroy function has finished.

Definition at line 210 of file IntrusiveRefCounts.h.

◆ maxStrongValue

constexpr CountType ripple::IntrusiveRefCounts::RefCountPair::maxStrongValue
staticconstexpr
Initial value:
=
static_cast<CountType>((one << StrongCountNumBits) - 1)
static constexpr size_t StrongCountNumBits
static constexpr FieldType one

Definition at line 218 of file IntrusiveRefCounts.h.

◆ maxWeakValue

constexpr CountType ripple::IntrusiveRefCounts::RefCountPair::maxWeakValue
staticconstexpr
Initial value:
=
static_cast<CountType>((one << WeakCountNumBits) - 1)
static constexpr size_t WeakCountNumBits

Definition at line 220 of file IntrusiveRefCounts.h.

◆ checkStrongMaxValue

constexpr CountType ripple::IntrusiveRefCounts::RefCountPair::checkStrongMaxValue = maxStrongValue - 32
staticconstexpr

Put an extra margin to detect when running up against limits.

This is only used in debug code, and is useful if we reduce the number of bits in the strong and weak counts (to 16 and 14 bits).

Definition at line 226 of file IntrusiveRefCounts.h.

◆ checkWeakMaxValue

constexpr CountType ripple::IntrusiveRefCounts::RefCountPair::checkWeakMaxValue = maxWeakValue - 32
staticconstexpr

Definition at line 227 of file IntrusiveRefCounts.h.