mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Use manual method for naming CountedObject classes
This commit is contained in:
@@ -101,8 +101,6 @@ public:
|
||||
getCounter ().decrement ();
|
||||
}
|
||||
|
||||
virtual char const* getCountedObjectName () = 0;
|
||||
|
||||
private:
|
||||
class Counter : public CountedObjects::CounterBase
|
||||
{
|
||||
@@ -111,23 +109,13 @@ private:
|
||||
|
||||
char const* getName () const noexcept
|
||||
{
|
||||
return getClassName ();
|
||||
return Object::getCountedObjectName ();
|
||||
}
|
||||
|
||||
void checkPureVirtual () const { }
|
||||
};
|
||||
|
||||
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
|
||||
{
|
||||
// VFALCO TODO Research the thread safety of static initializers
|
||||
|
||||
@@ -12,7 +12,7 @@ class STObject
|
||||
, public CountedObject <STObject>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "STObject"; }
|
||||
static char const* getCountedObjectName () { return "STObject"; }
|
||||
|
||||
STObject () : mType (NULL)
|
||||
{
|
||||
@@ -325,7 +325,7 @@ class STArray
|
||||
, public CountedObject <STArray>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "STArray"; }
|
||||
static char const* getCountedObjectName () { return "STArray"; }
|
||||
|
||||
typedef boost::ptr_vector<STObject> vector;
|
||||
typedef boost::ptr_vector<STObject>::iterator iterator;
|
||||
|
||||
@@ -41,7 +41,7 @@ class Ledger
|
||||
, public CountedObject <Ledger>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "Ledger"; }
|
||||
static char const* getCountedObjectName () { return "Ledger"; }
|
||||
|
||||
typedef boost::shared_ptr<Ledger> pointer;
|
||||
typedef const boost::shared_ptr<Ledger>& ref;
|
||||
|
||||
@@ -11,7 +11,7 @@ class LedgerProposal
|
||||
: public CountedObject <LedgerProposal>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "LedgerProposal"; }
|
||||
static char const* getCountedObjectName () { return "LedgerProposal"; }
|
||||
|
||||
static const uint32 seqLeave = 0xffffffff; // leaving the consensus process
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ class SerializedValidation
|
||||
, public CountedObject <SerializedValidation>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SerializedValidation"; }
|
||||
static char const* getCountedObjectName () { return "SerializedValidation"; }
|
||||
|
||||
typedef boost::shared_ptr<SerializedValidation> pointer;
|
||||
typedef const boost::shared_ptr<SerializedValidation>& ref;
|
||||
|
||||
@@ -32,7 +32,7 @@ class Transaction
|
||||
, public CountedObject <Transaction>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "Transaction"; }
|
||||
static char const* getCountedObjectName () { return "Transaction"; }
|
||||
|
||||
typedef boost::shared_ptr<Transaction> pointer;
|
||||
typedef const pointer& ref;
|
||||
|
||||
@@ -16,7 +16,7 @@ class TransactionEngine
|
||||
: public CountedObject <TransactionEngine>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "TransactionEngine"; }
|
||||
static char const* getCountedObjectName () { return "TransactionEngine"; }
|
||||
|
||||
private:
|
||||
LedgerEntrySet mNodes;
|
||||
|
||||
@@ -24,7 +24,7 @@ class WSConnection
|
||||
, public CountedObject <WSConnection <endpoint_type> >
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "WSConnection"; }
|
||||
static char const* getCountedObjectName () { return "WSConnection"; }
|
||||
|
||||
typedef typename endpoint_type::connection_type connection;
|
||||
typedef typename boost::shared_ptr<connection> connection_ptr;
|
||||
|
||||
@@ -13,7 +13,7 @@ private:
|
||||
class Entry : public CountedObject <Entry>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "HashRouterEntry"; }
|
||||
static char const* getCountedObjectName () { return "HashRouterEntry"; }
|
||||
|
||||
Entry ()
|
||||
: mFlags (0)
|
||||
|
||||
@@ -36,7 +36,7 @@ class HashedObject
|
||||
: public CountedObject <HashedObject>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "HashedObject"; }
|
||||
static char const* getCountedObjectName () { return "HashedObject"; }
|
||||
|
||||
typedef boost::shared_ptr <HashedObject> pointer;
|
||||
typedef pointer const& ref;
|
||||
|
||||
@@ -15,7 +15,7 @@ class InboundLedger
|
||||
, public CountedObject <InboundLedger>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "InboundLedger"; }
|
||||
static char const* getCountedObjectName () { return "InboundLedger"; }
|
||||
|
||||
typedef boost::shared_ptr <InboundLedger> pointer;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class InfoSub
|
||||
: public CountedObject <InfoSub>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "InfoSub"; }
|
||||
static char const* getCountedObjectName () { return "InfoSub"; }
|
||||
|
||||
typedef boost::shared_ptr<InfoSub> pointer;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class LedgerConsensus
|
||||
, public CountedObject <LedgerConsensus>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "LedgerConsensus"; }
|
||||
static char const* getCountedObjectName () { return "LedgerConsensus"; }
|
||||
|
||||
LedgerConsensus (LedgerHash const & prevLCLHash, Ledger::ref previousLedger, uint32 closeTime);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class LedgerEntrySetEntry
|
||||
: public CountedObject <LedgerEntrySetEntry>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "LedgerEntrySetEntry"; }
|
||||
static char const* getCountedObjectName () { return "LedgerEntrySetEntry"; }
|
||||
|
||||
SLE::pointer mEntry;
|
||||
LedgerEntryAction mAction;
|
||||
@@ -62,7 +62,7 @@ class LedgerEntrySet
|
||||
: public CountedObject <LedgerEntrySet>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "LedgerEntrySet"; }
|
||||
static char const* getCountedObjectName () { return "LedgerEntrySet"; }
|
||||
|
||||
LedgerEntrySet (Ledger::ref ledger, TransactionEngineParams tep, bool immutable = false) :
|
||||
mLedger (ledger), mParams (tep), mSeq (0), mImmutable (immutable)
|
||||
|
||||
@@ -24,7 +24,7 @@ class PeerImp : public Peer
|
||||
, public CountedObject <PeerImp>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "Peer"; }
|
||||
static char const* getCountedObjectName () { return "Peer"; }
|
||||
|
||||
PeerImp (boost::asio::io_service & io_service,
|
||||
boost::asio::ssl::context & ctx,
|
||||
|
||||
@@ -20,7 +20,7 @@ class SHAMap
|
||||
: public CountedObject <SHAMap>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SHAMap"; }
|
||||
static char const* getCountedObjectName () { return "SHAMap"; }
|
||||
|
||||
typedef boost::shared_ptr<SHAMap> pointer;
|
||||
typedef const boost::shared_ptr<SHAMap>& ref;
|
||||
|
||||
@@ -12,7 +12,7 @@ class SHAMapItem
|
||||
: public CountedObject <SHAMapItem>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SHAMapItem"; }
|
||||
static char const* getCountedObjectName () { return "SHAMapItem"; }
|
||||
|
||||
typedef boost::shared_ptr<SHAMapItem> pointer;
|
||||
typedef const boost::shared_ptr<SHAMapItem>& ref;
|
||||
|
||||
@@ -21,7 +21,7 @@ class SHAMapTreeNode
|
||||
, public CountedObject <SHAMapTreeNode>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SHAMapTreeNode"; }
|
||||
static char const* getCountedObjectName () { return "SHAMapTreeNode"; }
|
||||
|
||||
typedef boost::shared_ptr<SHAMapTreeNode> pointer;
|
||||
typedef const boost::shared_ptr<SHAMapTreeNode>& ref;
|
||||
|
||||
@@ -27,7 +27,7 @@ class SerializedLedgerEntry
|
||||
, public CountedObject <SerializedLedgerEntry>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SerializedLedgerEntry"; }
|
||||
static char const* getCountedObjectName () { return "SerializedLedgerEntry"; }
|
||||
|
||||
typedef boost::shared_ptr<SerializedLedgerEntry> pointer;
|
||||
typedef const boost::shared_ptr<SerializedLedgerEntry>& ref;
|
||||
|
||||
@@ -21,7 +21,7 @@ class SerializedTransaction
|
||||
, public CountedObject <SerializedTransaction>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "SerializedTransaction"; }
|
||||
static char const* getCountedObjectName () { return "SerializedTransaction"; }
|
||||
|
||||
typedef boost::shared_ptr<SerializedTransaction> pointer;
|
||||
typedef const boost::shared_ptr<SerializedTransaction>& ref;
|
||||
|
||||
@@ -15,7 +15,7 @@ class TransactionAcquire
|
||||
, public CountedObject <TransactionAcquire>
|
||||
{
|
||||
public:
|
||||
char const* getCountedObjectName () { return "TransactionAcquire"; }
|
||||
static char const* getCountedObjectName () { return "TransactionAcquire"; }
|
||||
|
||||
typedef boost::shared_ptr<TransactionAcquire> pointer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user