Use provided names for CountedObject instead of typeid()

This commit is contained in:
Vinnie Falco
2013-06-26 00:17:09 -07:00
parent 59b2824d46
commit fe15cfbf31
21 changed files with 47 additions and 0 deletions

View File

@@ -101,6 +101,8 @@ public:
getCounter ().decrement (); getCounter ().decrement ();
} }
virtual char const* getCountedObjectName () = 0;
private: private:
class Counter : public CountedObjects::CounterBase class Counter : public CountedObjects::CounterBase
{ {

View File

@@ -12,6 +12,8 @@ class STObject
, public CountedObject <STObject> , public CountedObject <STObject>
{ {
public: public:
char const* getCountedObjectName () { return "STObject"; }
STObject () : mType (NULL) STObject () : mType (NULL)
{ {
; ;
@@ -323,6 +325,8 @@ class STArray
, public CountedObject <STArray> , public CountedObject <STArray>
{ {
public: public:
char const* getCountedObjectName () { return "STArray"; }
typedef boost::ptr_vector<STObject> vector; typedef boost::ptr_vector<STObject> vector;
typedef boost::ptr_vector<STObject>::iterator iterator; typedef boost::ptr_vector<STObject>::iterator iterator;
typedef boost::ptr_vector<STObject>::const_iterator const_iterator; typedef boost::ptr_vector<STObject>::const_iterator const_iterator;

View File

@@ -41,6 +41,8 @@ class Ledger
, public CountedObject <Ledger> , public CountedObject <Ledger>
{ {
public: public:
char const* getCountedObjectName () { return "Ledger"; }
typedef boost::shared_ptr<Ledger> pointer; typedef boost::shared_ptr<Ledger> pointer;
typedef const boost::shared_ptr<Ledger>& ref; typedef const boost::shared_ptr<Ledger>& ref;

View File

@@ -11,6 +11,8 @@ class LedgerProposal
: public CountedObject <LedgerProposal> : public CountedObject <LedgerProposal>
{ {
public: public:
char const* getCountedObjectName () { return "LedgerProposal"; }
static const uint32 seqLeave = 0xffffffff; // leaving the consensus process static const uint32 seqLeave = 0xffffffff; // leaving the consensus process
typedef boost::shared_ptr<LedgerProposal> pointer; typedef boost::shared_ptr<LedgerProposal> pointer;

View File

@@ -12,6 +12,8 @@ class SerializedValidation
, public CountedObject <SerializedValidation> , public CountedObject <SerializedValidation>
{ {
public: public:
char const* getCountedObjectName () { return "SerializedValidation"; }
typedef boost::shared_ptr<SerializedValidation> pointer; typedef boost::shared_ptr<SerializedValidation> pointer;
typedef const boost::shared_ptr<SerializedValidation>& ref; typedef const boost::shared_ptr<SerializedValidation>& ref;

View File

@@ -32,6 +32,8 @@ class Transaction
, public CountedObject <Transaction> , public CountedObject <Transaction>
{ {
public: public:
char const* getCountedObjectName () { return "Transaction"; }
typedef boost::shared_ptr<Transaction> pointer; typedef boost::shared_ptr<Transaction> pointer;
typedef const pointer& ref; typedef const pointer& ref;

View File

@@ -15,6 +15,9 @@
class TransactionEngine class TransactionEngine
: public CountedObject <TransactionEngine> : public CountedObject <TransactionEngine>
{ {
public:
char const* getCountedObjectName () { return "TransactionEngine"; }
private: private:
LedgerEntrySet mNodes; LedgerEntrySet mNodes;

View File

@@ -24,6 +24,8 @@ class WSConnection
, public CountedObject <WSConnection <endpoint_type> > , public CountedObject <WSConnection <endpoint_type> >
{ {
public: public:
char const* getCountedObjectName () { return "WSConnection"; }
typedef typename endpoint_type::connection_type connection; typedef typename endpoint_type::connection_type connection;
typedef typename boost::shared_ptr<connection> connection_ptr; typedef typename boost::shared_ptr<connection> connection_ptr;
typedef typename boost::weak_ptr<connection> weak_connection_ptr; typedef typename boost::weak_ptr<connection> weak_connection_ptr;

View File

@@ -13,6 +13,8 @@ private:
class Entry : public CountedObject <Entry> class Entry : public CountedObject <Entry>
{ {
public: public:
char const* getCountedObjectName () { return "HashRouterEntry"; }
Entry () Entry ()
: mFlags (0) : mFlags (0)
{ {

View File

@@ -36,6 +36,8 @@ class HashedObject
: public CountedObject <HashedObject> : public CountedObject <HashedObject>
{ {
public: public:
char const* getCountedObjectName () { return "HashedObject"; }
typedef boost::shared_ptr <HashedObject> pointer; typedef boost::shared_ptr <HashedObject> pointer;
typedef pointer const& ref; typedef pointer const& ref;

View File

@@ -15,6 +15,8 @@ class InboundLedger
, public CountedObject <InboundLedger> , public CountedObject <InboundLedger>
{ {
public: public:
char const* getCountedObjectName () { return "InboundLedger"; }
typedef boost::shared_ptr <InboundLedger> pointer; typedef boost::shared_ptr <InboundLedger> pointer;
public: public:

View File

@@ -16,6 +16,8 @@ class InfoSub
: public CountedObject <InfoSub> : public CountedObject <InfoSub>
{ {
public: public:
char const* getCountedObjectName () { return "InfoSub"; }
typedef boost::shared_ptr<InfoSub> pointer; typedef boost::shared_ptr<InfoSub> pointer;
// VFALCO TODO Standardize on the names of weak / strong pointer typedefs. // VFALCO TODO Standardize on the names of weak / strong pointer typedefs.

View File

@@ -17,6 +17,8 @@ class LedgerConsensus
, public CountedObject <LedgerConsensus> , public CountedObject <LedgerConsensus>
{ {
public: public:
char const* getCountedObjectName () { return "LedgerConsensus"; }
LedgerConsensus (LedgerHash const & prevLCLHash, Ledger::ref previousLedger, uint32 closeTime); LedgerConsensus (LedgerHash const & prevLCLHash, Ledger::ref previousLedger, uint32 closeTime);
int startup (); int startup ();

View File

@@ -36,6 +36,8 @@ class LedgerEntrySetEntry
: public CountedObject <LedgerEntrySetEntry> : public CountedObject <LedgerEntrySetEntry>
{ {
public: public:
char const* getCountedObjectName () { return "LedgerEntrySetEntry"; }
SLE::pointer mEntry; SLE::pointer mEntry;
LedgerEntryAction mAction; LedgerEntryAction mAction;
int mSeq; int mSeq;
@@ -60,6 +62,8 @@ class LedgerEntrySet
: public CountedObject <LedgerEntrySet> : public CountedObject <LedgerEntrySet>
{ {
public: public:
char const* getCountedObjectName () { return "LedgerEntrySet"; }
LedgerEntrySet (Ledger::ref ledger, TransactionEngineParams tep, bool immutable = false) : LedgerEntrySet (Ledger::ref ledger, TransactionEngineParams tep, bool immutable = false) :
mLedger (ledger), mParams (tep), mSeq (0), mImmutable (immutable) mLedger (ledger), mParams (tep), mSeq (0), mImmutable (immutable)
{ {

View File

@@ -24,6 +24,8 @@ class PeerImp : public Peer
, public CountedObject <PeerImp> , public CountedObject <PeerImp>
{ {
public: public:
char const* getCountedObjectName () { return "Peer"; }
PeerImp (boost::asio::io_service & io_service, PeerImp (boost::asio::io_service & io_service,
boost::asio::ssl::context & ctx, boost::asio::ssl::context & ctx,
uint64 peerId, uint64 peerId,

View File

@@ -20,6 +20,8 @@ class SHAMap
: public CountedObject <SHAMap> : public CountedObject <SHAMap>
{ {
public: public:
char const* getCountedObjectName () { return "SHAMap"; }
typedef boost::shared_ptr<SHAMap> pointer; typedef boost::shared_ptr<SHAMap> pointer;
typedef const boost::shared_ptr<SHAMap>& ref; typedef const boost::shared_ptr<SHAMap>& ref;

View File

@@ -12,6 +12,8 @@ class SHAMapItem
: public CountedObject <SHAMapItem> : public CountedObject <SHAMapItem>
{ {
public: public:
char const* getCountedObjectName () { return "SHAMapItem"; }
typedef boost::shared_ptr<SHAMapItem> pointer; typedef boost::shared_ptr<SHAMapItem> pointer;
typedef const boost::shared_ptr<SHAMapItem>& ref; typedef const boost::shared_ptr<SHAMapItem>& ref;

View File

@@ -21,6 +21,8 @@ class SHAMapTreeNode
, public CountedObject <SHAMapTreeNode> , public CountedObject <SHAMapTreeNode>
{ {
public: public:
char const* getCountedObjectName () { return "SHAMapTreeNode"; }
typedef boost::shared_ptr<SHAMapTreeNode> pointer; typedef boost::shared_ptr<SHAMapTreeNode> pointer;
typedef const boost::shared_ptr<SHAMapTreeNode>& ref; typedef const boost::shared_ptr<SHAMapTreeNode>& ref;

View File

@@ -27,6 +27,8 @@ class SerializedLedgerEntry
, public CountedObject <SerializedLedgerEntry> , public CountedObject <SerializedLedgerEntry>
{ {
public: public:
char const* getCountedObjectName () { return "SerializedLedgerEntry"; }
typedef boost::shared_ptr<SerializedLedgerEntry> pointer; typedef boost::shared_ptr<SerializedLedgerEntry> pointer;
typedef const boost::shared_ptr<SerializedLedgerEntry>& ref; typedef const boost::shared_ptr<SerializedLedgerEntry>& ref;

View File

@@ -21,6 +21,8 @@ class SerializedTransaction
, public CountedObject <SerializedTransaction> , public CountedObject <SerializedTransaction>
{ {
public: public:
char const* getCountedObjectName () { return "SerializedTransaction"; }
typedef boost::shared_ptr<SerializedTransaction> pointer; typedef boost::shared_ptr<SerializedTransaction> pointer;
typedef const boost::shared_ptr<SerializedTransaction>& ref; typedef const boost::shared_ptr<SerializedTransaction>& ref;

View File

@@ -15,6 +15,8 @@ class TransactionAcquire
, public CountedObject <TransactionAcquire> , public CountedObject <TransactionAcquire>
{ {
public: public:
char const* getCountedObjectName () { return "TransactionAcquire"; }
typedef boost::shared_ptr<TransactionAcquire> pointer; typedef boost::shared_ptr<TransactionAcquire> pointer;
public: public: