|
xrpld
|
A leaf node for a transaction. More...
#include <SHAMapTxLeafNode.h>


Public Member Functions | |
| SHAMapTxLeafNode (boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid) | |
| SHAMapTxLeafNode (boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid, SHAMapHash const &hash) | |
| SHAMapTreeNodePtr | clone (std::uint32_t cowid) const final |
| Make a copy of this node, setting the owner. | |
| SHAMapNodeType | getType () const final |
| Determines the type of node. | |
| void | updateHash () final |
| Recalculate the hash of this node. | |
| void | serializeForWire (Serializer &s) const final |
| Serialize the node in a format appropriate for sending over the wire. | |
| void | serializeWithPrefix (Serializer &s) const final |
| Serialize the node in a format appropriate for hashing. | |
| bool | isLeaf () const final |
| Determines if this is a leaf node. | |
| bool | isInner () const final |
| Determines if this is an inner node. | |
| void | invariants (bool isRoot=false) const final |
| boost::intrusive_ptr< SHAMapItem const > const & | peekItem () const |
| bool | setItem (boost::intrusive_ptr< SHAMapItem const > i) |
| Set the item that this node points to and update the node's hash. | |
| std::string | getString (SHAMapNodeID const &) const final |
| virtual void | partialDestructor () |
| std::uint32_t | cowid () const |
| Returns the SHAMap that owns this node. | |
| void | unshare () |
| If this node is shared with another map, mark it as no longer shared. | |
| SHAMapHash const & | getHash () const |
| Return the hash of this node. | |
| void | addStrongRef () const noexcept |
| void | addWeakRef () const noexcept |
| ReleaseStrongRefAction | releaseStrongRef () const |
| ReleaseStrongRefAction | addWeakReleaseStrongRef () const |
| ReleaseWeakRefAction | releaseWeakRef () const |
| bool | checkoutStrongRefFromWeak () const noexcept |
| bool | expired () const noexcept |
| std::size_t | useCount () const noexcept |
Static Public Member Functions | |
| static SHAMapTreeNodePtr | makeFromPrefix (Slice rawNode, SHAMapHash const &hash) |
| static SHAMapTreeNodePtr | makeFromWire (Slice rawNode) |
Public Attributes | |
| friend | Object |
Protected Attributes | |
| boost::intrusive_ptr< SHAMapItem const > | item_ |
| SHAMapHash | hash_ |
| std::uint32_t | cowid_ |
| Determines the owning SHAMap, if any. | |
Private Types | |
| using | CountType = std::uint16_t |
| using | FieldType = std::uint32_t |
Static Private Member Functions | |
| static SHAMapTreeNodePtr | makeTransaction (Slice data, SHAMapHash const &hash, bool hashValid) |
| static SHAMapTreeNodePtr | makeAccountState (Slice data, SHAMapHash const &hash, bool hashValid) |
| static SHAMapTreeNodePtr | makeTransactionWithMeta (Slice data, SHAMapHash const &hash, bool hashValid) |
| static auto & | getCounter () noexcept |
Private Attributes | |
| std::atomic< FieldType > | refCounts_ {kStrongDelta} |
| refCounts consists of four fields that are treated atomically: | |
Static Private Attributes | |
| static constexpr size_t | kStrongCountNumBits = sizeof(CountType) * 8 |
| static constexpr size_t | kWeakCountNumBits = kStrongCountNumBits - 2 |
| static constexpr size_t | kFieldTypeBits = sizeof(FieldType) * 8 |
| static constexpr FieldType | kOne = 1 |
| static constexpr FieldType | kStrongDelta = 1 |
| Amount to change the strong count when adding or releasing a reference. | |
| static constexpr FieldType | kWeakDelta = (kOne << kStrongCountNumBits) |
| Amount to change the weak count when adding or releasing a reference. | |
| static constexpr FieldType | kPartialDestroyStartedMask = (kOne << (kFieldTypeBits - 1)) |
| Flag that is set when the partialDestroy function has started running (or is about to start running). | |
| static constexpr FieldType | kPartialDestroyFinishedMask = (kOne << (kFieldTypeBits - 2)) |
| Flag that is set when the partialDestroy function has finished running. | |
| static constexpr FieldType | kTagMask = kPartialDestroyStartedMask | kPartialDestroyFinishedMask |
| Mask that will zero out all the count bits and leave the tag bits unchanged. | |
| static constexpr FieldType | kValueMask = ~kTagMask |
| Mask that will zero out the tag bits and leave the count bits unchanged. | |
| static constexpr FieldType | kStrongMask = ((kOne << kStrongCountNumBits) - 1) & kValueMask |
| Mask that will zero out everything except the strong count. | |
| static constexpr FieldType | kWeakMask |
| Mask that will zero out everything except the weak count. | |
A leaf node for a transaction.
No metadata is included.
Definition at line 21 of file SHAMapTxLeafNode.h.
|
privateinherited |
Definition at line 104 of file IntrusiveRefCounts.h.
|
privateinherited |
Definition at line 107 of file IntrusiveRefCounts.h.
| xrpl::SHAMapTxLeafNode::SHAMapTxLeafNode | ( | boost::intrusive_ptr< SHAMapItem const > | item, |
| std::uint32_t | cowid ) |
Definition at line 24 of file SHAMapTxLeafNode.h.
| xrpl::SHAMapTxLeafNode::SHAMapTxLeafNode | ( | boost::intrusive_ptr< SHAMapItem const > | item, |
| std::uint32_t | cowid, | ||
| SHAMapHash const & | hash ) |
Definition at line 30 of file SHAMapTxLeafNode.h.
|
finalvirtual |
Make a copy of this node, setting the owner.
Implements xrpl::SHAMapTreeNode.
Definition at line 39 of file SHAMapTxLeafNode.h.
|
finalvirtual |
Determines the type of node.
Implements xrpl::SHAMapTreeNode.
Definition at line 45 of file SHAMapTxLeafNode.h.
|
finalvirtual |
Recalculate the hash of this node.
Implements xrpl::SHAMapTreeNode.
Definition at line 51 of file SHAMapTxLeafNode.h.
|
finalvirtual |
Serialize the node in a format appropriate for sending over the wire.
Implements xrpl::SHAMapTreeNode.
Definition at line 57 of file SHAMapTxLeafNode.h.
|
finalvirtual |
Serialize the node in a format appropriate for hashing.
Implements xrpl::SHAMapTreeNode.
Definition at line 64 of file SHAMapTxLeafNode.h.
|
finalvirtualinherited |
Determines if this is a leaf node.
Implements xrpl::SHAMapTreeNode.
Definition at line 34 of file SHAMapLeafNode.h.
|
finalvirtualinherited |
Determines if this is an inner node.
Implements xrpl::SHAMapTreeNode.
Definition at line 40 of file SHAMapLeafNode.h.
|
finalvirtualinherited |
Implements xrpl::SHAMapTreeNode.
Definition at line 93 of file SHAMapLeafNode.cpp.
|
inherited |
Definition at line 41 of file SHAMapLeafNode.cpp.
|
inherited |
Set the item that this node points to and update the node's hash.
| i | the new item |
Definition at line 47 of file SHAMapLeafNode.cpp.
|
finalvirtualinherited |
Reimplemented from xrpl::SHAMapTreeNode.
Definition at line 60 of file SHAMapLeafNode.cpp.
|
virtualinherited |
Reimplemented in xrpl::SHAMapInnerNode.
Definition at line 77 of file SHAMapTreeNode.h.
|
inherited |
Return the hash of this node.
Definition at line 139 of file SHAMapTreeNode.h.
|
staticinherited |
Definition at line 159 of file SHAMapTreeNode.cpp.
|
staticinherited |
Definition at line 128 of file SHAMapTreeNode.cpp.
|
staticprivateinherited |
Definition at line 29 of file SHAMapTreeNode.cpp.
|
staticprivateinherited |
Definition at line 87 of file SHAMapTreeNode.cpp.
|
staticprivateinherited |
Definition at line 47 of file SHAMapTreeNode.cpp.
|
noexceptinherited |
Definition at line 246 of file IntrusiveRefCounts.h.
|
noexceptinherited |
Definition at line 252 of file IntrusiveRefCounts.h.
|
inherited |
Definition at line 258 of file IntrusiveRefCounts.h.
|
inherited |
Definition at line 306 of file IntrusiveRefCounts.h.
|
inherited |
Definition at line 359 of file IntrusiveRefCounts.h.
|
noexceptinherited |
Definition at line 386 of file IntrusiveRefCounts.h.
|
noexceptinherited |
Definition at line 403 of file IntrusiveRefCounts.h.
|
noexceptinherited |
Definition at line 410 of file IntrusiveRefCounts.h.
|
staticprivatenoexceptinherited |
Definition at line 113 of file CountedObject.h.
|
protectedinherited |
Definition at line 19 of file SHAMapLeafNode.h.
|
protectedinherited |
Definition at line 40 of file SHAMapTreeNode.h.
|
protectedinherited |
Determines the owning SHAMap, if any.
Used for copy-on-write semantics.
If this value is 0, the node is not dirty and does not need to be flushed. It is eligible for sharing and may be included multiple SHAMap instances.
Definition at line 49 of file SHAMapTreeNode.h.
|
staticconstexprprivateinherited |
Definition at line 105 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Definition at line 106 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Definition at line 108 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Definition at line 109 of file IntrusiveRefCounts.h.
|
mutableprivateinherited |
refCounts consists of four fields that are treated atomically:
Definition at line 144 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Amount to change the strong count when adding or releasing a reference.
Note: The strong count is stored in the low StrongCountNumBits bits of refCounts
Definition at line 152 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Amount to change the weak count when adding or releasing a reference.
Note: The weak count is stored in the high WeakCountNumBits bits of refCounts
Definition at line 160 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Flag that is set when the partialDestroy function has started running (or is about to start running).
See description of the refCounts field for a fuller description of this field.
Definition at line 169 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Flag that is set when the partialDestroy function has finished running.
See description of the refCounts field for a fuller description of this field.
Definition at line 177 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Mask that will zero out all the count bits and leave the tag bits unchanged.
Definition at line 183 of file IntrusiveRefCounts.h.
Mask that will zero out the tag bits and leave the count bits unchanged.
Definition at line 189 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Mask that will zero out everything except the strong count.
Definition at line 194 of file IntrusiveRefCounts.h.
|
staticconstexprprivateinherited |
Mask that will zero out everything except the weak count.
Definition at line 199 of file IntrusiveRefCounts.h.
|
inherited |
Definition at line 138 of file CountedObject.h.