Finalizing of metadata building.

This commit is contained in:
JoelKatz
2012-08-22 14:56:01 -07:00
parent c120a4cada
commit e00426a3be
3 changed files with 18 additions and 7 deletions

View File

@@ -230,26 +230,36 @@ Json::Value LedgerEntrySet::getJson(int) const
return ret;
}
void LedgerEntrySet::addRawMeta(Serializer& s)
void LedgerEntrySet::addRawMeta(Serializer& s, Ledger::pointer origLedger)
{
for (boost::unordered_map<uint256, LedgerEntrySetEntry>::const_iterator it = mEntries.begin(),
end = mEntries.end(); it != end; ++it)
{
int nType = TMNEndOfMetadata;
switch (it->second.mAction)
{
case taaMODIFY:
// WRITEME
nType = TMNModifiedNode;
break;
case taaDELETE:
// WRITEME
nType = TMNDeletedNode;
break;
case taaCREATE:
// WRITEME
nType = TMNCreatedNode;
break;
default:
// ignore these
break;
}
if (nType != TMNEndOfMetadata)
{
SLE::pointer origNode = origLedger->getSLE(it->first);
SLE::pointer curNode = it->second.mEntry;
// FINISH
}
}
mSet.addRaw(s);
}

View File

@@ -5,6 +5,7 @@
#include "SerializedLedger.h"
#include "TransactionMeta.h"
#include "Ledger.h"
enum LedgerEntryAction
{
@@ -42,7 +43,7 @@ public:
// set functions
LedgerEntrySet duplicate() const; // Make a duplicate of this set
void setTo(const LedgerEntrySet&); // Set this set to have the same contents as another
void setTo(const LedgerEntrySet&); // Set this set to have the same contents as another
void swapWith(LedgerEntrySet&); // Swap the contents of two sets
int getSeq() const { return mSeq; }
@@ -59,7 +60,7 @@ public:
void entryModify(const SLE::pointer&); // This entry will be modified
Json::Value getJson(int) const;
void addRawMeta(Serializer&);
void addRawMeta(Serializer&, Ledger::pointer originalLedger);
// iterator functions
bool isEmpty() const { return mEntries.empty(); }

View File

@@ -175,7 +175,7 @@ public:
void swap(TransactionMetaSet&);
bool isNodeAffected(const uint256&) const;
TransactionMetaNode& getAffectedNode(const uint256&);
TransactionMetaNode& getAffectedNode(const uint256&, int type);
const TransactionMetaNode& peekAffectedNode(const uint256&) const;
Json::Value getJson(int) const;