mirror of
https://github.com/Xahau/xahaud.git
synced 2026-07-27 17:10:15 +00:00
51 lines
974 B
C++
51 lines
974 B
C++
|
|
SETUP_LOG (HashedObject)
|
|
|
|
DECLARE_INSTANCE (HashedObject);
|
|
|
|
HashedObject::HashedObject (
|
|
HashedObjectType type,
|
|
LedgerIndex ledgerIndex,
|
|
Blob const& binaryDataToCopy,
|
|
uint256 const& hash)
|
|
: mType (type)
|
|
, mHash (hash)
|
|
, mLedgerIndex (ledgerIndex)
|
|
, mData (binaryDataToCopy)
|
|
{
|
|
}
|
|
|
|
HashedObject::HashedObject (
|
|
HashedObjectType type,
|
|
LedgerIndex ledgerIndex,
|
|
void const* bufferToCopy,
|
|
int bytesInBuffer,
|
|
uint256 const& hash)
|
|
: mType (type)
|
|
, mHash (hash)
|
|
, mLedgerIndex (ledgerIndex)
|
|
, mData (static_cast <unsigned char const*> (bufferToCopy),
|
|
static_cast <unsigned char const*> (bufferToCopy) + bytesInBuffer)
|
|
{
|
|
}
|
|
|
|
HashedObjectType HashedObject::getType () const
|
|
{
|
|
return mType;
|
|
}
|
|
|
|
uint256 const& HashedObject::getHash () const
|
|
{
|
|
return mHash;
|
|
}
|
|
|
|
LedgerIndex HashedObject::getIndex () const
|
|
{
|
|
return mLedgerIndex;
|
|
}
|
|
|
|
Blob const& HashedObject::getData () const
|
|
{
|
|
return mData;
|
|
}
|