mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Mark a huge number of ugly functions deprecated. You no longer need to use the special
'IField' functions. You can treat a ledger entry like any STObject.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
#include "LedgerFormats.h"
|
#include "LedgerFormats.h"
|
||||||
#include "NewcoinAddress.h"
|
#include "NewcoinAddress.h"
|
||||||
|
|
||||||
class SerializedLedgerEntry : public SerializedType
|
class SerializedLedgerEntry : public STObject
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef boost::shared_ptr<SerializedLedgerEntry> pointer;
|
typedef boost::shared_ptr<SerializedLedgerEntry> pointer;
|
||||||
@@ -14,8 +14,6 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
uint256 mIndex;
|
uint256 mIndex;
|
||||||
LedgerEntryType mType;
|
LedgerEntryType mType;
|
||||||
STUInt16 mVersion;
|
|
||||||
STObject mObject;
|
|
||||||
const LedgerEntryFormat* mFormat;
|
const LedgerEntryFormat* mFormat;
|
||||||
|
|
||||||
SerializedLedgerEntry* duplicate() const { return new SerializedLedgerEntry(*this); }
|
SerializedLedgerEntry* duplicate() const { return new SerializedLedgerEntry(*this); }
|
||||||
@@ -29,40 +27,15 @@ public:
|
|||||||
std::string getFullText() const;
|
std::string getFullText() const;
|
||||||
std::string getText() const;
|
std::string getText() const;
|
||||||
Json::Value getJson(int options) const;
|
Json::Value getJson(int options) const;
|
||||||
void add(Serializer& s) const { mVersion.add(s); mObject.add(s); }
|
|
||||||
virtual bool isEquivalent(const SerializedType& t) const;
|
virtual bool isEquivalent(const SerializedType& t) const;
|
||||||
|
|
||||||
bool setFlag(uint32 uSet) { return mObject.setFlag(uSet); }
|
const uint256& getIndex() const;
|
||||||
bool clearFlag(uint32 uClear) { return mObject.clearFlag(uClear); }
|
void setIndex(const uint256& i);
|
||||||
uint32 getFlags() const { return mObject.getFlags(); }
|
|
||||||
|
|
||||||
const uint256& getIndex() const { return mIndex; }
|
|
||||||
void setIndex(const uint256& i) { mIndex = i; }
|
|
||||||
|
|
||||||
LedgerEntryType getType() const { return mType; }
|
LedgerEntryType getType() const { return mType; }
|
||||||
uint16 getVersion() const { return mVersion.getValue(); }
|
uint16 getVersion() const { return getValueFieldU16(sfLedgerEntryType); }
|
||||||
const LedgerEntryFormat* getFormat() { return mFormat; }
|
const LedgerEntryFormat* getFormat() { return mFormat; }
|
||||||
|
|
||||||
int getIFieldIndex(SField::ref field) const { return mObject.getFieldIndex(field); }
|
|
||||||
int getIFieldCount() const { return mObject.getCount(); }
|
|
||||||
const SerializedType& peekIField(SField::ref field) const { return mObject.peekAtField(field); }
|
|
||||||
SerializedType& getIField(SField::ref field) { return mObject.getField(field); }
|
|
||||||
SField::ref getIFieldSType(int index) { return mObject.getFieldSType(index); }
|
|
||||||
|
|
||||||
std::string getIFieldString(SField::ref field) const { return mObject.getFieldString(field); }
|
|
||||||
unsigned char getIFieldU8(SField::ref field) const { return mObject.getValueFieldU8(field); }
|
|
||||||
uint16 getIFieldU16(SField::ref field) const { return mObject.getValueFieldU16(field); }
|
|
||||||
uint32 getIFieldU32(SField::ref field) const { return mObject.getValueFieldU32(field); }
|
|
||||||
uint64 getIFieldU64(SField::ref field) const { return mObject.getValueFieldU64(field); }
|
|
||||||
uint128 getIFieldH128(SField::ref field) const { return mObject.getValueFieldH128(field); }
|
|
||||||
uint160 getIFieldH160(SField::ref field) const { return mObject.getValueFieldH160(field); }
|
|
||||||
uint256 getIFieldH256(SField::ref field) const { return mObject.getValueFieldH256(field); }
|
|
||||||
std::vector<unsigned char> getIFieldVL(SField::ref field) const { return mObject.getValueFieldVL(field); }
|
|
||||||
std::vector<TaggedListItem> getIFieldTL(SField::ref field) const { return mObject.getValueFieldTL(field); }
|
|
||||||
NewcoinAddress getIValueFieldAccount(SField::ref field) const { return mObject.getValueFieldAccount(field); }
|
|
||||||
STAmount getIValueFieldAmount(SField::ref field) const { return mObject.getValueFieldAmount(field); }
|
|
||||||
STVector256 getIFieldV256(SField::ref field) { return mObject.getValueFieldV256(field); }
|
|
||||||
|
|
||||||
bool isThreadedType(); // is this a ledger entry that can be threaded
|
bool isThreadedType(); // is this a ledger entry that can be threaded
|
||||||
bool isThreaded(); // is this ledger entry actually threaded
|
bool isThreaded(); // is this ledger entry actually threaded
|
||||||
bool hasOneOwner(); // This node has one other node that owns it (like nickname)
|
bool hasOneOwner(); // This node has one other node that owns it (like nickname)
|
||||||
@@ -75,28 +48,49 @@ public:
|
|||||||
bool thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID);
|
bool thread(const uint256& txID, uint32 ledgerSeq, uint256& prevTxID, uint32& prevLedgerID);
|
||||||
std::vector<uint256> getOwners(); // nodes notified if this node is deleted
|
std::vector<uint256> getOwners(); // nodes notified if this node is deleted
|
||||||
|
|
||||||
void setIFieldU8(SField::ref field, unsigned char v) { return mObject.setValueFieldU8(field, v); }
|
// CAUTION: All these functions are now obsolete and will be removed after
|
||||||
void setIFieldU16(SField::ref field, uint16 v) { return mObject.setValueFieldU16(field, v); }
|
// the new serialization code is merged.
|
||||||
void setIFieldU32(SField::ref field, uint32 v) { return mObject.setValueFieldU32(field, v); }
|
int getIFieldIndex(SField::ref field) const { return getFieldIndex(field); }
|
||||||
void setIFieldU64(SField::ref field, uint64 v) { return mObject.setValueFieldU64(field, v); }
|
int getIFieldCount() const { return getCount(); }
|
||||||
void setIFieldH128(SField::ref field, const uint128& v) { return mObject.setValueFieldH128(field, v); }
|
const SerializedType& peekIField(SField::ref field) const { return peekAtField(field); }
|
||||||
void setIFieldH160(SField::ref field, const uint160& v) { return mObject.setValueFieldH160(field, v); }
|
SerializedType& getIField(SField::ref field) { return getField(field); }
|
||||||
void setIFieldH256(SField::ref field, const uint256& v) { return mObject.setValueFieldH256(field, v); }
|
SField::ref getIFieldSType(int index) { return getFieldSType(index); }
|
||||||
|
std::string getIFieldString(SField::ref field) const { return getFieldString(field); }
|
||||||
|
unsigned char getIFieldU8(SField::ref field) const { return getValueFieldU8(field); }
|
||||||
|
uint16 getIFieldU16(SField::ref field) const { return getValueFieldU16(field); }
|
||||||
|
uint32 getIFieldU32(SField::ref field) const { return getValueFieldU32(field); }
|
||||||
|
uint64 getIFieldU64(SField::ref field) const { return getValueFieldU64(field); }
|
||||||
|
uint128 getIFieldH128(SField::ref field) const { return getValueFieldH128(field); }
|
||||||
|
uint160 getIFieldH160(SField::ref field) const { return getValueFieldH160(field); }
|
||||||
|
uint256 getIFieldH256(SField::ref field) const { return getValueFieldH256(field); }
|
||||||
|
std::vector<unsigned char> getIFieldVL(SField::ref field) const { return getValueFieldVL(field); }
|
||||||
|
std::vector<TaggedListItem> getIFieldTL(SField::ref field) const { return getValueFieldTL(field); }
|
||||||
|
NewcoinAddress getIValueFieldAccount(SField::ref field) const { return getValueFieldAccount(field); }
|
||||||
|
STAmount getIValueFieldAmount(SField::ref field) const { return getValueFieldAmount(field); }
|
||||||
|
STVector256 getIFieldV256(SField::ref field) { return getValueFieldV256(field); }
|
||||||
|
void setIFieldU8(SField::ref field, unsigned char v) { return setValueFieldU8(field, v); }
|
||||||
|
void setIFieldU16(SField::ref field, uint16 v) { return setValueFieldU16(field, v); }
|
||||||
|
void setIFieldU32(SField::ref field, uint32 v) { return setValueFieldU32(field, v); }
|
||||||
|
void setIFieldU64(SField::ref field, uint64 v) { return setValueFieldU64(field, v); }
|
||||||
|
void setIFieldH128(SField::ref field, const uint128& v) { return setValueFieldH128(field, v); }
|
||||||
|
void setIFieldH160(SField::ref field, const uint160& v) { return setValueFieldH160(field, v); }
|
||||||
|
void setIFieldH256(SField::ref field, const uint256& v) { return setValueFieldH256(field, v); }
|
||||||
void setIFieldVL(SField::ref field, const std::vector<unsigned char>& v)
|
void setIFieldVL(SField::ref field, const std::vector<unsigned char>& v)
|
||||||
{ return mObject.setValueFieldVL(field, v); }
|
{ return setValueFieldVL(field, v); }
|
||||||
void setIFieldTL(SField::ref field, const std::vector<TaggedListItem>& v)
|
void setIFieldTL(SField::ref field, const std::vector<TaggedListItem>& v)
|
||||||
{ return mObject.setValueFieldTL(field, v); }
|
{ return setValueFieldTL(field, v); }
|
||||||
void setIFieldAccount(SField::ref field, const uint160& account)
|
void setIFieldAccount(SField::ref field, const uint160& account)
|
||||||
{ return mObject.setValueFieldAccount(field, account); }
|
{ return setValueFieldAccount(field, account); }
|
||||||
void setIFieldAccount(SField::ref field, const NewcoinAddress& account)
|
void setIFieldAccount(SField::ref field, const NewcoinAddress& account)
|
||||||
{ return mObject.setValueFieldAccount(field, account); }
|
{ return setValueFieldAccount(field, account); }
|
||||||
void setIFieldAmount(SField::ref field, const STAmount& amount)
|
void setIFieldAmount(SField::ref field, const STAmount& amount)
|
||||||
{ return mObject.setValueFieldAmount(field, amount); }
|
{ return setValueFieldAmount(field, amount); }
|
||||||
void setIFieldV256(SField::ref field, const STVector256& v) { return mObject.setValueFieldV256(field, v); }
|
void setIFieldV256(SField::ref field, const STVector256& v) { return setValueFieldV256(field, v); }
|
||||||
|
bool getIFieldPresent(SField::ref field) const { return isFieldPresent(field); }
|
||||||
|
void makeIFieldPresent(SField::ref field) { makeFieldPresent(field); }
|
||||||
|
void makeIFieldAbsent(SField::ref field) { return makeFieldAbsent(field); }
|
||||||
|
// CAUTION: All the above functions are obsolete
|
||||||
|
|
||||||
bool getIFieldPresent(SField::ref field) const { return mObject.isFieldPresent(field); }
|
|
||||||
void makeIFieldPresent(SField::ref field) { mObject.makeFieldPresent(field); }
|
|
||||||
void makeIFieldAbsent(SField::ref field) { return mObject.makeFieldAbsent(field); }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef SerializedLedgerEntry SLE;
|
typedef SerializedLedgerEntry SLE;
|
||||||
|
|||||||
Reference in New Issue
Block a user