Yate
GenObject Class Reference

#include <yateclass.h>

Inheritance diagram for GenObject:
ASNObjId AnalogLineEvent AsnMib AsnObject AsnValue Cipher DataBlock DnsRecord GenPointer< Obj > HashList JIDIdentity MGCPEpInfo ObjList ObjVector RTPGroup RTPProcessor RTPSecure RadioReadBufs RefObject RemoteBackupSubsystem SS7PointCode SS7SCCPDataSegment SS7TCAPComponent SS7TCAPMessage ScriptAsync ScriptParser ScriptRun SignallingFactory SignallingMessageTimer SocketAddr SocketFilter String ClientFileItem ClientLogic JBConnect JBEngine JBStreamSet JGRtpMedia MathVectorBase MessageDispatcher MessageReceiver MimeBody Plugin SASL TranslatorFactory Window XmlChild

Public Member Functions

 GenObject ()
 
virtual ~GenObject ()
 
virtual bool alive () const
 
virtual void destruct ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () 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()

◆ ~GenObject()

virtual ~GenObject ( )
inlinevirtual

Destructor.

References setObjCounter().

Member Function Documentation

◆ alive()

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.

◆ destruct()

virtual void destruct ( )
virtual

◆ getObjCounter() [1/2]

NamedCounter * getObjCounter ( ) const
inline

Get the counter of this object

Returns
Pointer to current counter object

Referenced by TempObjectCounter::TempObjectCounter(), and TempObjectCounter::TempObjectCounter().

◆ getObjCounter() [2/2]

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

◆ getObjCounters()

static ObjList & getObjCounters ( )
static

Access the object counters list

Returns
Reference to the global object counters list

◆ getObjCounting()

static bool getObjCounting ( )
inlinestatic

Get the global state of object counting

Returns
True if object counting is enabled

Referenced by TempObjectCounter::TempObjectCounter(), TempObjectCounter::TempObjectCounter(), and TempObjectCounter::TempObjectCounter().

◆ getObject() [1/2]

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 Array, Cipher, DataBlock, ExpWrapper, HashList, ISDNQ931Call, ISDNQ931CallMonitor, ISDNQ931Message, NamedList, NamedPointer, NamedString, ObjList, ObjVector, RefObject, ScriptContext, SocketFilter, SocketRef, SS7ISUPCall, String, CallEndpoint, Channel, DataConsumer, DataEndpoint, DataSource, DataTranslator, Driver, JBStream, Message, MimeAuthLine, MimeBinaryBody, MimeBody, MimeHeaderLine, MimeLinesBody, MimeMultipartBody, MimeSdpBody, MimeStringBody, Module, and Plugin.

Referenced by getObject().

◆ getObject() [2/2]

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(), and getObject().

◆ setObjCounter()

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().

◆ setObjCounting()

static void setObjCounting ( bool enable)
inlinestatic

Set the global state of object counting

Parameters
enableTrue to enable object counting, false to disable

◆ toString()

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 AnalogLine, AsnMib, ASNObjId, ChanAssist, MGCPEndpoint, MGCPEpInfo, NamedString, RadioInterface, ScriptContext, SignallingComponent, SS7TCAPComponent, SS7TCAPTransaction, String, CallEndpoint, ClientAccount, ClientContact, ClientFileItem, ClientLogic, ClientResource, DataEndpoint, DurationUpdate, JBConnect, JBStream, JBStreamSetList, JGRtpMedia, JGSessionContent, Plugin, Window, and XmlElement.

◆ traceId()

virtual const String & traceId ( ) const
virtual

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