rippled
|
A simple object that the Ledger uses to store entries. More...
Classes | |
struct | PrivateAccess |
Public Member Functions | |
NodeObject (NodeObjectType type, Blob &&data, uint256 const &hash, PrivateAccess) | |
NodeObjectType | getType () const |
Returns the type of this object. More... | |
uint256 const & | getHash () const |
Returns the hash of the data. More... | |
Blob const & | getData () const |
Returns the underlying data. More... | |
Static Public Member Functions | |
static std::shared_ptr< NodeObject > | createObject (NodeObjectType type, Blob &&data, uint256 const &hash) |
Create an object from fields. More... | |
Static Public Attributes | |
static constexpr std::size_t | keyBytes = 32 |
Static Private Member Functions | |
static auto & | getCounter () noexcept |
Private Attributes | |
const NodeObjectType | mType |
const uint256 | mHash |
const Blob | mData |
A simple object that the Ledger uses to store entries.
NodeObjects are comprised of a type, a hash, and a blob. They can be uniquely identified by the hash, which is a half-SHA512 of the blob. The blob is a variable length block of serialized data. The type identifies what the blob contains.
Definition at line 49 of file NodeObject.h.
ripple::NodeObject::NodeObject | ( | NodeObjectType | type, |
Blob && | data, | ||
uint256 const & | hash, | ||
PrivateAccess | |||
) |
Definition at line 27 of file NodeObject.cpp.
|
static |
Create an object from fields.
The caller's variable is modified during this call. The underlying storage for the Blob is taken over by the NodeObject.
type | The type of object. |
ledgerIndex | The ledger in which this object appears. |
data | A buffer containing the payload. The caller's variable is overwritten. |
hash | The 256-bit hash of the payload data. |
Definition at line 37 of file NodeObject.cpp.
NodeObjectType ripple::NodeObject::getType | ( | ) | const |
Returns the type of this object.
Definition at line 44 of file NodeObject.cpp.
uint256 const & ripple::NodeObject::getHash | ( | ) | const |
Returns the hash of the data.
Definition at line 50 of file NodeObject.cpp.
Blob const & ripple::NodeObject::getData | ( | ) | const |
Returns the underlying data.
Definition at line 56 of file NodeObject.cpp.
|
staticprivatenoexceptinherited |
Definition at line 128 of file CountedObject.h.
|
staticconstexpr |
Definition at line 52 of file NodeObject.h.
|
private |
Definition at line 98 of file NodeObject.h.
|
private |
Definition at line 99 of file NodeObject.h.
|
private |
Definition at line 100 of file NodeObject.h.