# class GenObject | An object with just a public virtual destructor More...
Full name | `TelEngine::GenObject`
Definition | `#include <yateclass.h>`
Inherited by | Array, Base64, CallEndpoint, CapturedEvent, Channel, Cipher, Client, ClientAccount, ClientAccountList, ClientChannel, ClientContact, ClientDir, ClientDriver, ClientDriver, ClientFile, ClientFileItem, ClientLogic, ClientResource, ClientSound, Compressor, Configuration, DataBlock, DataConsumer, DataEndpoint, DataFormat, DataNode, DataSource, DataTranslator, DefaultLogic, DnsRecord, Driver, Driver, DurationUpdate, GenPointer, HashList, Message, MessageDispatcher, MessageHandler, MessageHook, MessagePostHook, MessageQueue, MessageReceiver, MessageRelay, MimeAuthLine, MimeBinaryBody, MimeBody, MimeHeaderLine, MimeLinesBody, MimeMultipartBody, MimeSdpBody, MimeStringBody, Module, Module, MucRoom, MucRoomMember, NamedCounter, NamedInt, NamedList, NamedPointer, NamedString, NaptrRecord, ObjList, ObjVector, Plugin, RefObject, Regexp, SocketAddr, SocketFilter, SrvRecord, String, ThreadedSource, TranslatorFactory, TxtRecord, UIFactory, UIWidget, URI, Window, XmlCData, XmlChild, XmlComment, XmlDeclaration, XmlDoctype, XmlElement, XmlText
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- GenObject ()
- virtual ~GenObject ()
- virtual bool alive () const
- virtual void destruct ()
- virtual const String& toString () const
- virtual void* getObject (const String& name) const
- inline NamedCounter* getObjCounter () const
- NamedCounter* setObjCounter (NamedCounter* counter)

#### Public Static Methods

- static inline void* getObject (const String& name, const GenObject* obj)
- static inline bool getObjCounting ()
- static inline void setObjCounting (bool enable)
- static NamedCounter* getObjCounter (const String& name, bool create = true)
- static ObjList& getObjCounters ()

## Detailed Description

An object with just a public virtual destructor

GenObject () | ### GenObject

Default constructor

~GenObject () | ### ~GenObject

[virtual]

Destructor.

bool alive () | ### 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

void destruct () | ### destruct

[virtual]

Destroys the object, disposes the memory.

const String& toString () | ### 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

void* getObject (const String& name) | ### getObject

[const virtual]

Get a pointer to a derived class given that class name

Parameters:

name | Name of the class we are asking for

Returns: Pointer to the requested class or NULL if this object doesn't implement it

inline void* getObject (const String& name, const GenObject* obj) | ### getObject

[static]

Helper method to get the pointer to a derived class

Parameters:

name | Name of the class we are asking for
obj | Pointer to the object to get derived class from

Returns: Pointer to the requested class or NULL if this object doesn't implement it

inline bool getObjCounting () | ### getObjCounting

[static]

Get the global state of object counting

Returns: True if object counting is enabled

inline void setObjCounting (bool enable) | ### setObjCounting

[static]

Set the global state of object counting

Parameters:

enable | True to enable object counting, false to disable

inline NamedCounter* getObjCounter () | ### getObjCounter

[const]

Get the counter of this object

Returns: Pointer to current counter object

NamedCounter* setObjCounter (NamedCounter* counter) | ### setObjCounter

Set the counter of this object

Parameters:

counter | New counter object or NULL

Returns: Pointer to old counter object

NamedCounter* getObjCounter (const String& name, bool create = true) | ### getObjCounter

[static]

Retrieve or allocate an object counter

Parameters:

name | Name of the counter
create | True to create a new counter if needed

Returns: Pointer to existing or new counter object

ObjList& getObjCounters () | ### getObjCounters

[static]

Access the object counters list

Returns: Reference to the global object counters list

Generated by: paulc on bussard on Fri May 8 12:37:22 2015, using kdoc 2.0a54.