Add more counted types.

This commit is contained in:
JoelKatz
2012-10-31 16:11:59 -07:00
parent 9098c3f739
commit 8e4b11b668
8 changed files with 25 additions and 6 deletions

View File

@@ -5,6 +5,8 @@
#include "Ledger.h"
#include "Log.h"
DECLARE_INSTANCE(SerializedLedgerEntry)
SerializedLedgerEntry::SerializedLedgerEntry(SerializerIterator& sit, const uint256& index)
: STObject(sfLedgerEntry), mIndex(index)
{

View File

@@ -4,8 +4,11 @@
#include "SerializedObject.h"
#include "LedgerFormats.h"
#include "RippleAddress.h"
#include "InstanceCounter.h"
class SerializedLedgerEntry : public STObject
DEFINE_INSTANCE(SerializedLedgerEntry);
class SerializedLedgerEntry : public STObject, private IS_INSTANCE(SerializedLedgerEntry)
{
public:
typedef boost::shared_ptr<SerializedLedgerEntry> pointer;

View File

@@ -14,6 +14,8 @@
#include "SerializedTransaction.h"
SETUP_LOG();
DECLARE_INSTANCE(SerializedObject);
DECLARE_INSTANCE(SerializedArray);
std::auto_ptr<SerializedType> STObject::makeDefaultObject(SerializedTypeID id, SField::ref name)
{

View File

@@ -8,6 +8,10 @@
#include "../json/value.h"
#include "SerializedTypes.h"
#include "InstanceCounter.h"
DEFINE_INSTANCE(SerializedObject);
DEFINE_INSTANCE(SerializedArray);
// Serializable object/array types
@@ -22,7 +26,7 @@ public:
SOElement(SField::ref fi, SOE_Flags fl) : e_field(fi), flags(fl) { ; }
};
class STObject : public SerializedType
class STObject : public SerializedType, private IS_INSTANCE(SerializedObject)
{
protected:
boost::ptr_vector<SerializedType> mData;
@@ -175,7 +179,7 @@ namespace boost
class STArray : public SerializedType
class STArray : public SerializedType, private IS_INSTANCE(SerializedArray)
{
public:
typedef std::vector<STObject> vector;

View File

@@ -8,6 +8,8 @@
#include "Log.h"
#include "HashPrefixes.h"
DECLARE_INSTANCE(SerializedTransaction);
SerializedTransaction::SerializedTransaction(TransactionType type) : STObject(sfTransaction), mType(type)
{
mFormat = TransactionFormat::getTxnFormat(type);

View File

@@ -9,6 +9,7 @@
#include "SerializedObject.h"
#include "TransactionFormats.h"
#include "RippleAddress.h"
#include "InstanceCounter.h"
#define TXN_SQL_NEW 'N'
#define TXN_SQL_CONFLICT 'C'
@@ -17,7 +18,9 @@
#define TXN_SQL_INCLUDED 'I'
#define TXN_SQL_UNKNOWN 'U'
class SerializedTransaction : public STObject
DEFINE_INSTANCE(SerializedTransaction);
class SerializedTransaction : public STObject, private IS_INSTANCE(SerializedTransaction)
{
public:
typedef boost::shared_ptr<SerializedTransaction> pointer;

View File

@@ -14,6 +14,7 @@
#include "TransactionErr.h"
SETUP_LOG();
DECLARE_INSTANCE(SerializedEntry);
STAmount saZero(CURRENCY_ONE, ACCOUNT_ONE, 0);
STAmount saOne(CURRENCY_ONE, ACCOUNT_ONE, 1);

View File

@@ -9,7 +9,7 @@
#include "uint256.h"
#include "Serializer.h"
#include "FieldNames.h"
#include "InstanceCounter.h"
enum PathFlags
{
@@ -30,7 +30,9 @@ enum PathFlags
#define ACCOUNT_XNS uint160(0)
#define ACCOUNT_ONE uint160(1) // Used as a place holder
class SerializedType
DEFINE_INSTANCE(SerializedEntry);
class SerializedType : private IS_INSTANCE(SerializedEntry)
{
protected:
SField::ptr fName;