mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 21:45:52 +00:00
Use manual method for naming CountedObject classes
This commit is contained in:
@@ -101,8 +101,6 @@ public:
|
|||||||
getCounter ().decrement ();
|
getCounter ().decrement ();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual char const* getCountedObjectName () = 0;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Counter : public CountedObjects::CounterBase
|
class Counter : public CountedObjects::CounterBase
|
||||||
{
|
{
|
||||||
@@ -111,23 +109,13 @@ private:
|
|||||||
|
|
||||||
char const* getName () const noexcept
|
char const* getName () const noexcept
|
||||||
{
|
{
|
||||||
return getClassName ();
|
return Object::getCountedObjectName ();
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkPureVirtual () const { }
|
void checkPureVirtual () const { }
|
||||||
};
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/* Due to a bug in Visual Studio 10 and earlier, the string returned by
|
|
||||||
typeid().name() will appear to leak on exit. Therefore, we should
|
|
||||||
only call this function when there's an actual leak, or else there
|
|
||||||
will be spurious leak notices at exit.
|
|
||||||
*/
|
|
||||||
static char const* getClassName () noexcept
|
|
||||||
{
|
|
||||||
return typeid (Object).name ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static Counter& getCounter () noexcept
|
static Counter& getCounter () noexcept
|
||||||
{
|
{
|
||||||
// VFALCO TODO Research the thread safety of static initializers
|
// VFALCO TODO Research the thread safety of static initializers
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class STObject
|
|||||||
, public CountedObject <STObject>
|
, public CountedObject <STObject>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "STObject"; }
|
static char const* getCountedObjectName () { return "STObject"; }
|
||||||
|
|
||||||
STObject () : mType (NULL)
|
STObject () : mType (NULL)
|
||||||
{
|
{
|
||||||
@@ -325,7 +325,7 @@ class STArray
|
|||||||
, public CountedObject <STArray>
|
, public CountedObject <STArray>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "STArray"; }
|
static 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;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Ledger
|
|||||||
, public CountedObject <Ledger>
|
, public CountedObject <Ledger>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "Ledger"; }
|
static 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;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class LedgerProposal
|
|||||||
: public CountedObject <LedgerProposal>
|
: public CountedObject <LedgerProposal>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "LedgerProposal"; }
|
static char const* getCountedObjectName () { return "LedgerProposal"; }
|
||||||
|
|
||||||
static const uint32 seqLeave = 0xffffffff; // leaving the consensus process
|
static const uint32 seqLeave = 0xffffffff; // leaving the consensus process
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class SerializedValidation
|
|||||||
, public CountedObject <SerializedValidation>
|
, public CountedObject <SerializedValidation>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SerializedValidation"; }
|
static 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;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ class Transaction
|
|||||||
, public CountedObject <Transaction>
|
, public CountedObject <Transaction>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "Transaction"; }
|
static 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;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class TransactionEngine
|
|||||||
: public CountedObject <TransactionEngine>
|
: public CountedObject <TransactionEngine>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "TransactionEngine"; }
|
static char const* getCountedObjectName () { return "TransactionEngine"; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LedgerEntrySet mNodes;
|
LedgerEntrySet mNodes;
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class WSConnection
|
|||||||
, public CountedObject <WSConnection <endpoint_type> >
|
, public CountedObject <WSConnection <endpoint_type> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "WSConnection"; }
|
static 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;
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ private:
|
|||||||
class Entry : public CountedObject <Entry>
|
class Entry : public CountedObject <Entry>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "HashRouterEntry"; }
|
static char const* getCountedObjectName () { return "HashRouterEntry"; }
|
||||||
|
|
||||||
Entry ()
|
Entry ()
|
||||||
: mFlags (0)
|
: mFlags (0)
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class HashedObject
|
|||||||
: public CountedObject <HashedObject>
|
: public CountedObject <HashedObject>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "HashedObject"; }
|
static 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;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class InboundLedger
|
|||||||
, public CountedObject <InboundLedger>
|
, public CountedObject <InboundLedger>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "InboundLedger"; }
|
static char const* getCountedObjectName () { return "InboundLedger"; }
|
||||||
|
|
||||||
typedef boost::shared_ptr <InboundLedger> pointer;
|
typedef boost::shared_ptr <InboundLedger> pointer;
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class InfoSub
|
|||||||
: public CountedObject <InfoSub>
|
: public CountedObject <InfoSub>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "InfoSub"; }
|
static char const* getCountedObjectName () { return "InfoSub"; }
|
||||||
|
|
||||||
typedef boost::shared_ptr<InfoSub> pointer;
|
typedef boost::shared_ptr<InfoSub> pointer;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class LedgerConsensus
|
|||||||
, public CountedObject <LedgerConsensus>
|
, public CountedObject <LedgerConsensus>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "LedgerConsensus"; }
|
static char const* getCountedObjectName () { return "LedgerConsensus"; }
|
||||||
|
|
||||||
LedgerConsensus (LedgerHash const & prevLCLHash, Ledger::ref previousLedger, uint32 closeTime);
|
LedgerConsensus (LedgerHash const & prevLCLHash, Ledger::ref previousLedger, uint32 closeTime);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class LedgerEntrySetEntry
|
|||||||
: public CountedObject <LedgerEntrySetEntry>
|
: public CountedObject <LedgerEntrySetEntry>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "LedgerEntrySetEntry"; }
|
static char const* getCountedObjectName () { return "LedgerEntrySetEntry"; }
|
||||||
|
|
||||||
SLE::pointer mEntry;
|
SLE::pointer mEntry;
|
||||||
LedgerEntryAction mAction;
|
LedgerEntryAction mAction;
|
||||||
@@ -62,7 +62,7 @@ class LedgerEntrySet
|
|||||||
: public CountedObject <LedgerEntrySet>
|
: public CountedObject <LedgerEntrySet>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "LedgerEntrySet"; }
|
static 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)
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class PeerImp : public Peer
|
|||||||
, public CountedObject <PeerImp>
|
, public CountedObject <PeerImp>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "Peer"; }
|
static 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,
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ class SHAMap
|
|||||||
: public CountedObject <SHAMap>
|
: public CountedObject <SHAMap>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SHAMap"; }
|
static 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;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class SHAMapItem
|
|||||||
: public CountedObject <SHAMapItem>
|
: public CountedObject <SHAMapItem>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SHAMapItem"; }
|
static 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;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class SHAMapTreeNode
|
|||||||
, public CountedObject <SHAMapTreeNode>
|
, public CountedObject <SHAMapTreeNode>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SHAMapTreeNode"; }
|
static 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;
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class SerializedLedgerEntry
|
|||||||
, public CountedObject <SerializedLedgerEntry>
|
, public CountedObject <SerializedLedgerEntry>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SerializedLedgerEntry"; }
|
static 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;
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ class SerializedTransaction
|
|||||||
, public CountedObject <SerializedTransaction>
|
, public CountedObject <SerializedTransaction>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "SerializedTransaction"; }
|
static 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;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class TransactionAcquire
|
|||||||
, public CountedObject <TransactionAcquire>
|
, public CountedObject <TransactionAcquire>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
char const* getCountedObjectName () { return "TransactionAcquire"; }
|
static char const* getCountedObjectName () { return "TransactionAcquire"; }
|
||||||
|
|
||||||
typedef boost::shared_ptr<TransactionAcquire> pointer;
|
typedef boost::shared_ptr<TransactionAcquire> pointer;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user