#ifndef __HASHEDOBJECT__ #define __HASHEDOBJECT__ #include #include #include "types.h" #include "uint256.h" enum HashedObjectType { UNKNOWN=0, LEDGER=1, TRANSACTION=2, ACCOUNT_NODE=3, TRANSACTION_NODE=4 }; class HashedObject { public: typedef boost::shared_ptr pointer; HashedObjectType mType; uint256 mHash; uint32 mLedgerIndex; std::vector mData; HashedObject(HashedObjectType type, uint32 index, const std::vector& data) : mType(type), mLedgerIndex(index), mData(data) { ; } bool checkHash() const; bool checkFixHash(); void setHash(); const std::vector& getData() { return mData; } bool store() const; static bool store(HashedObjectType type, uint32 index, const std::vector& data, const uint256& hash); static HashedObject::pointer retrieve(const uint256& hash); }; #endif