xrpld
Loading...
Searching...
No Matches
SHAMapTxLeafNode.h
1#pragma once
2
3#include <xrpl/basics/CountedObject.h>
4#include <xrpl/protocol/HashPrefix.h>
5#include <xrpl/protocol/digest.h>
6#include <xrpl/shamap/SHAMapItem.h>
7#include <xrpl/shamap/SHAMapLeafNode.h>
8
9namespace xrpl {
10
12class SHAMapTxLeafNode final : public SHAMapLeafNode, public CountedObject<SHAMapTxLeafNode>
13{
14public:
15 SHAMapTxLeafNode(boost::intrusive_ptr<SHAMapItem const> item, std::uint32_t cowid)
16 : SHAMapLeafNode(std::move(item), cowid)
17 {
18 updateHash();
19 }
20
22 boost::intrusive_ptr<SHAMapItem const> item,
24 SHAMapHash const& hash)
25 : SHAMapLeafNode(std::move(item), cowid, hash)
26 {
27 }
28
34
36 getType() const final
37 {
39 }
40
41 void
46
47 void
49 {
50 s.addRaw(item_->slice());
52 }
53
54 void
56 {
58 s.addRaw(item_->slice());
59 }
60};
61
62} // namespace xrpl
boost::intrusive_ptr< SHAMapItem const > item_
SHAMapLeafNode(boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid)
void updateHash() final
Recalculate the hash of this node.
void serializeWithPrefix(Serializer &s) const final
Serialize the node in a format appropriate for hashing.
SHAMapTxLeafNode(boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid, SHAMapHash const &hash)
SHAMapNodeType getType() const final
Determines the type of node.
SHAMapTreeNodePtr clone(std::uint32_t cowid) const final
Make a copy of this node, setting the owner.
SHAMapTxLeafNode(boost::intrusive_ptr< SHAMapItem const > item, std::uint32_t cowid)
void serializeForWire(Serializer &s) const final
Serialize the node in a format appropriate for sending over the wire.
std::uint32_t cowid() const
Returns the SHAMap that owns this node.
STL namespace.
SharedPtr< T > makeShared(A &&... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
intr_ptr::SharedPtr< SHAMapTreeNode > SHAMapTreeNodePtr
sha512_half_hasher::result_type sha512Half(Args const &... args)
Returns the SHA512-Half of a series of objects.
Definition digest.h:204
static constexpr unsigned char const kWireTypeTransaction
@ TransactionId
transaction plus signature to give transaction ID
Definition HashPrefix.h:36