Yate
Public Member Functions | Static Public Member Functions | List of all members
GenObject Class Reference

#include <yateclass.h>

Inheritance diagram for GenObject:
Cipher ClientFileItem ClientLogic DataBlock DnsRecord GenPointer< Obj > HashList MathVectorBase MessageDispatcher MessageReceiver MimeBody ObjList ObjVector Plugin RefObject SocketAddr SocketFilter String TranslatorFactory Window XmlChild

Public Member Functions

 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual void * getObject (const String &name) const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Detailed Description

An object with just a public virtual destructor

Constructor & Destructor Documentation

GenObject ( )

Default constructor

virtual ~GenObject ( )
inlinevirtual

Destructor.

References GenObject::setObjCounter().

Member Function Documentation

virtual bool alive ( ) const
virtual

Check if the object is still valid and safe to access. Note that you should not trust this result unless the object is locked by other means.

Returns
True if the object is still useable

Reimplemented in RefObject.

virtual void destruct ( )
virtual

Destroys the object, disposes the memory.

Reimplemented in ClientSound, ClientLogic, RefObject, and MessageHandler.

Referenced by TelEngine::destruct(), and ClientSound::destruct().

NamedCounter* getObjCounter ( ) const
inline

Get the counter of this object

Returns
Pointer to current counter object

Referenced by TempObjectCounter::TempObjectCounter().

static NamedCounter* getObjCounter ( const String name,
bool  create = true 
)
static

Retrieve or allocate an object counter

Parameters
nameName of the counter
createTrue to create a new counter if needed
Returns
Pointer to existing or new counter object
static ObjList& getObjCounters ( )
static

Access the object counters list

Returns
Reference to the global object counters list
static bool getObjCounting ( )
inlinestatic

Get the global state of object counting

Returns
True if object counting is enabled
virtual void* getObject ( const String name) const
virtual

Get a pointer to a derived class given that class name

Parameters
nameName of the class we are asking for
Returns
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented in Cipher, SocketFilter, NamedList, DataBlock, HashList, NamedPointer, NamedString, Driver, String, Channel, Array, ObjVector, Module, ObjList, CallEndpoint, Plugin, RefObject, DataEndpoint, MimeLinesBody, MimeStringBody, MimeBinaryBody, DataTranslator, MimeSdpBody, MimeMultipartBody, DataSource, DataConsumer, Message, MimeBody, MimeAuthLine, and MimeHeaderLine.

Referenced by GenObject::getObject(), and NamedPointer::userObject().

static void* getObject ( const String name,
const GenObject obj 
)
inlinestatic

Helper method to get the pointer to a derived class

Parameters
nameName of the class we are asking for
objPointer to the object to get derived class from
Returns
Pointer to the requested class or NULL if this object doesn't implement it

References GenObject::getObject().

NamedCounter* setObjCounter ( NamedCounter counter)

Set the counter of this object

Parameters
counterNew counter object or NULL
Returns
Pointer to old counter object

Referenced by GenObject::~GenObject().

static void setObjCounting ( bool  enable)
inlinestatic

Set the global state of object counting

Parameters
enableTrue to enable object counting, false to disable
virtual const String& toString ( ) const
virtual

Get a string representation of this object

Returns
A reference to a String representing this object which is either null, the object itself (for objects derived from String) or some form of identification

Reimplemented in ClientFileItem, DurationUpdate, ClientResource, ClientContact, ClientAccount, NamedString, ClientLogic, String, XmlElement, CallEndpoint, Plugin, DataEndpoint, and Window.


The documentation for this class was generated from the following file: