xrpld
Toggle main menu visibility
Loading...
Searching...
No Matches
libxrpl
nodestore
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
9
namespace
xrpl
{
10
11
//------------------------------------------------------------------------------
12
13
NodeObject::NodeObject
(
NodeObjectType
type,
Blob
&& data,
UInt256
const
& hash,
PrivateAccess
)
14
:
type_
(type),
hash_
(hash),
data_
(
std
::move(data))
15
{
16
}
17
18
std::shared_ptr<NodeObject>
19
NodeObject::createObject
(
NodeObjectType
type,
Blob
&& data,
UInt256
const
& hash)
20
{
21
return
std::make_shared<NodeObject>
(type, std::move(data), hash,
PrivateAccess
());
22
}
23
24
NodeObjectType
25
NodeObject::getType
()
const
26
{
27
return
type_
;
28
}
29
30
UInt256
const
&
31
NodeObject::getHash
()
const
32
{
33
return
hash_
;
34
}
35
36
Blob
const
&
37
NodeObject::getData
()
const
38
{
39
return
data_
;
40
}
41
42
}
// namespace xrpl
xrpl::NodeObject::data_
Blob const data_
Definition
NodeObject.h:90
xrpl::NodeObject::NodeObject
NodeObject(NodeObjectType type, Blob &&data, UInt256 const &hash, PrivateAccess)
Definition
NodeObject.cpp:13
xrpl::NodeObject::getHash
UInt256 const & getHash() const
Returns the hash of the data.
Definition
NodeObject.cpp:31
xrpl::NodeObject::hash_
UInt256 const hash_
Definition
NodeObject.h:89
xrpl::NodeObject::getType
NodeObjectType getType() const
Returns the type of this object.
Definition
NodeObject.cpp:25
xrpl::NodeObject::createObject
static std::shared_ptr< NodeObject > createObject(NodeObjectType type, Blob &&data, UInt256 const &hash)
Create an object from fields.
Definition
NodeObject.cpp:19
xrpl::NodeObject::type_
NodeObjectType const type_
Definition
NodeObject.h:88
xrpl::NodeObject::getData
Blob const & getData() const
Returns the underlying data.
Definition
NodeObject.cpp:37
std::make_shared
T make_shared(T... args)
memory
std
STL namespace.
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::NodeObjectType
NodeObjectType
The types of node objects.
Definition
NodeObject.h:18
xrpl::UInt256
BaseUInt< 256 > UInt256
Definition
base_uint.h:580
xrpl::Blob
std::vector< unsigned char > Blob
Storage for linear binary data.
Definition
Blob.h:11
std::shared_ptr
xrpl::NodeObject::PrivateAccess
Definition
NodeObject.h:46
utility
Generated by
1.17.0