xrpld
Loading...
Searching...
No Matches
NodeObject.cpp
1#include <xrpl/nodestore/NodeObject.h>
2
3#include <xrpl/basics/Blob.h>
4#include <xrpl/basics/base_uint.h>
5
6#include <memory>
7#include <utility>
8
9namespace xrpl {
10
11//------------------------------------------------------------------------------
12
14 : type_(type), hash_(hash), data_(std::move(data))
15{
16}
17
20{
21 return std::make_shared<NodeObject>(type, std::move(data), hash, PrivateAccess());
22}
23
26{
27 return type_;
28}
29
30uint256 const&
32{
33 return hash_;
34}
35
36Blob const&
38{
39 return data_;
40}
41
42} // namespace xrpl
uint256 const hash_
Definition NodeObject.h:75
Blob const data_
Definition NodeObject.h:76
NodeObject(NodeObjectType type, Blob &&data, uint256 const &hash, PrivateAccess)
NodeObjectType getType() const
Returns the type of this object.
static std::shared_ptr< NodeObject > createObject(NodeObjectType type, Blob &&data, uint256 const &hash)
Create an object from fields.
NodeObjectType const type_
Definition NodeObject.h:74
uint256 const & getHash() const
Returns the hash of the data.
Blob const & getData() const
Returns the underlying data.
T make_shared(T... args)
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
NodeObjectType
The types of node objects.
Definition NodeObject.h:12
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition Blob.h:10
BaseUInt< 256 > uint256
Definition base_uint.h:562