mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +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;
|
||||
|
||||
Reference in New Issue
Block a user