mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Moved cpp code to src/cpp and js code to src/js.
This commit is contained in:
60
src/cpp/ripple/RippleState.h
Normal file
60
src/cpp/ripple/RippleState.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef __RIPPLESTATE__
|
||||
#define __RIPPLESTATE__
|
||||
|
||||
//
|
||||
// A ripple line's state.
|
||||
// - Isolate ledger entry format.
|
||||
//
|
||||
|
||||
#include "SerializedLedger.h"
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class RippleState
|
||||
{
|
||||
public:
|
||||
typedef boost::shared_ptr<RippleState> pointer;
|
||||
|
||||
private:
|
||||
SerializedLedgerEntry::pointer mLedgerEntry;
|
||||
|
||||
RippleAddress mLowID;
|
||||
RippleAddress mHighID;
|
||||
|
||||
STAmount mLowLimit;
|
||||
STAmount mHighLimit;
|
||||
|
||||
uint64 mLowQualityIn;
|
||||
uint64 mLowQualityOut;
|
||||
uint64 mHighQualityIn;
|
||||
uint64 mHighQualityOut;
|
||||
|
||||
STAmount mBalance;
|
||||
|
||||
bool mValid;
|
||||
bool mViewLowest;
|
||||
|
||||
public:
|
||||
RippleState(SerializedLedgerEntry::pointer ledgerEntry); // For accounts in a ledger
|
||||
|
||||
void setViewAccount(const uint160& accountID);
|
||||
|
||||
const RippleAddress getAccountID() const { return mViewLowest ? mLowID : mHighID; }
|
||||
const RippleAddress getAccountIDPeer() const { return mViewLowest ? mHighID : mLowID; }
|
||||
|
||||
STAmount getBalance() const { return mBalance; }
|
||||
|
||||
STAmount getLimit() const { return mViewLowest ? mLowLimit : mHighLimit; }
|
||||
STAmount getLimitPeer() const { return mViewLowest ? mHighLimit : mLowLimit; }
|
||||
|
||||
uint32 getQualityIn() const { return((uint32) (mViewLowest ? mLowQualityIn : mHighQualityIn)); }
|
||||
uint32 getQualityOut() const { return((uint32) (mViewLowest ? mLowQualityOut : mHighQualityOut)); }
|
||||
|
||||
SerializedLedgerEntry::pointer getSLE() { return mLedgerEntry; }
|
||||
const SerializedLedgerEntry& peekSLE() const { return *mLedgerEntry; }
|
||||
SerializedLedgerEntry& peekSLE() { return *mLedgerEntry; }
|
||||
|
||||
std::vector<unsigned char> getRaw() const;
|
||||
};
|
||||
#endif
|
||||
// vim:ts=4
|
||||
Reference in New Issue
Block a user