mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-27 22:45:52 +00:00
Tidy up
This commit is contained in:
@@ -1103,6 +1103,49 @@ void Ledger::visitAccountItems(const uint160& accountID, FUNCTION_TYPE<void(SLE:
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
// VFALCO: A proof of concept for making an iterator instead of a visitor
|
||||
class AccountItemIterator
|
||||
{
|
||||
public:
|
||||
explicit AccountItemIterator (uint160 const& accountID)
|
||||
{
|
||||
// Convert the account ID to the root hash
|
||||
//
|
||||
m_rootKey = Ledger::getOwnerDirIndex (accountID);
|
||||
|
||||
// Start iterating from the root
|
||||
//
|
||||
m_currentKey = rootKey;
|
||||
|
||||
}
|
||||
|
||||
SerializedLedgerEntry::ref operator* () const
|
||||
{
|
||||
return m_currentEntry;
|
||||
}
|
||||
|
||||
SerializedLedgerEntry::ref end () const
|
||||
{
|
||||
return s_end;
|
||||
}
|
||||
|
||||
AccountItemIterator& operator++ (int)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
static SerializedLedgerEntry s_end;
|
||||
|
||||
uint256 m_rootKey;
|
||||
uint256 m_currentKey;
|
||||
|
||||
SerializedLedgerEntry::pointer m_currentEntry;
|
||||
}
|
||||
// typedef const boost::shared_ptr<SerializedLedgerEntry>& ref;
|
||||
*/
|
||||
|
||||
|
||||
uint256 Ledger::getFirstLedgerIndex()
|
||||
{
|
||||
SHAMapItem::pointer node = mAccountStateMap->peekFirstItem();
|
||||
|
||||
@@ -241,6 +241,9 @@ public:
|
||||
// Owner functions
|
||||
//
|
||||
|
||||
// VFALCO NOTE This is a simple math operation that converts the account ID
|
||||
// into a 256 bit object (I think....need to research this)
|
||||
//
|
||||
// All items controlled by an account are here: offers
|
||||
static uint256 getOwnerDirIndex(const uint160& uAccountID);
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
class NicknameState
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<NicknameState> pointer;
|
||||
typedef boost::shared_ptr <NicknameState> pointer;
|
||||
|
||||
public:
|
||||
NicknameState(SerializedLedgerEntry::pointer ledgerEntry); // For accounts in a ledger
|
||||
explicit NicknameState (SerializedLedgerEntry::pointer ledgerEntry); // For accounts in a ledger
|
||||
|
||||
bool haveMinimumOffer() const;
|
||||
STAmount getMinimumOffer() const;
|
||||
|
||||
@@ -3,18 +3,14 @@
|
||||
|
||||
class Offer : public AccountItem
|
||||
{
|
||||
RippleAddress mAccount;
|
||||
STAmount mTakerGets;
|
||||
STAmount mTakerPays;
|
||||
int mSeq;
|
||||
|
||||
|
||||
Offer(SerializedLedgerEntry::pointer ledgerEntry); // For accounts in a ledger
|
||||
public:
|
||||
Offer(){}
|
||||
virtual ~Offer(){}
|
||||
AccountItem::pointer makeItem(const uint160&, SerializedLedgerEntry::ref ledgerEntry);
|
||||
LedgerEntryType getType(){ return(ltOFFER); }
|
||||
Offer () {}
|
||||
|
||||
virtual ~Offer(){}
|
||||
|
||||
AccountItem::pointer makeItem (const uint160&, SerializedLedgerEntry::ref ledgerEntry);
|
||||
|
||||
LedgerEntryType getType(){ return(ltOFFER); }
|
||||
|
||||
const STAmount& getTakerPays(){ return(mTakerPays); }
|
||||
const STAmount& getTakerGets(){ return(mTakerGets); }
|
||||
@@ -22,6 +18,15 @@ public:
|
||||
int getSeq(){ return(mSeq); }
|
||||
Json::Value getJson(int);
|
||||
|
||||
private:
|
||||
// For accounts in a ledger
|
||||
explicit Offer (SerializedLedgerEntry::pointer ledgerEntry);
|
||||
|
||||
private:
|
||||
RippleAddress mAccount;
|
||||
STAmount mTakerGets;
|
||||
STAmount mTakerPays;
|
||||
int mSeq;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -5,6 +5,14 @@
|
||||
// Fetch ledger entries from an account's owner dir.
|
||||
//
|
||||
/** Base class representing account items.
|
||||
|
||||
Account items include:
|
||||
|
||||
- Offers
|
||||
- Trust Lines
|
||||
|
||||
NOTE these are deprecated and will go away, to be replaced with
|
||||
simple visitor patterns.
|
||||
*/
|
||||
class AccountItem
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user