Replace Serializer with Blob in SHAMapItem:

* This helps decouples SHAMap and Serializer.
* Restyle data member names.
* Rename getTag() to key().
This commit is contained in:
Howard Hinnant
2015-06-23 17:59:07 -04:00
committed by Vinnie Falco
parent 72659d431e
commit 26bfeb1319
17 changed files with 92 additions and 137 deletions

View File

@@ -18,35 +18,23 @@
//==============================================================================
#include <BeastConfig.h>
#include <ripple/protocol/Serializer.h>
#include <ripple/shamap/SHAMapItem.h>
namespace ripple {
class SHAMap;
SHAMapItem::SHAMapItem (uint256 const& tag, Blob const& data)
: mTag (tag)
, mData (data.data(), data.size())
: tag_(tag)
, data_(data)
{
}
SHAMapItem::SHAMapItem (uint256 const& tag, const Serializer& data)
: mTag (tag)
, mData (data.data(), data.size())
: tag_ (tag)
, data_(data.peekData())
{
}
SHAMapItem::SHAMapItem (uint256 const& key, Serializer&& s)
: mTag(key)
, mData(std::move(s))
{
}
// VFALCO This function appears not to be called
void SHAMapItem::dump (beast::Journal journal)
{
if (journal.info) journal.info <<
"SHAMapItem(" << mTag << ") " << mData.size () << "bytes";
}
} // ripple