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 ();
}
virtual char const* getCountedObjectName () = 0;
private:
class Counter : public CountedObjects::CounterBase
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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