Yate: Plugin Class Reference

Yate

Public Member Functions | List of all members
Plugin Class Referenceabstract

Plugin support. More...

`#include <yatengine.h>`

Inheritance diagram for Plugin:

## Public Member Functions
| Plugin (const char *name, bool earlyInit=false)
virtual | ~Plugin ()
virtual const String & | toString () const
virtual void * | getObject (const String &name) const
virtual void | initialize ()=0
virtual bool | isBusy () const
const String & | name () const
NamedCounter * | objectsCounter () const
bool | earlyInit () const
Public Member Functions inherited from GenObject
| GenObject ()
virtual | ~GenObject ()
virtual bool | alive () const
virtual void | destruct ()
virtual const String & | traceId () const
NamedCounter * | getObjCounter () const
NamedCounter * | setObjCounter (NamedCounter *counter)
Public Member Functions inherited from DebugEnabler
| DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
int | debugLevel () const
int | debugLevel (int level)
bool | debugEnabled () const
void | debugEnabled (bool enable)
const char * | debugName () const
bool | debugAt (int level) const
bool | debugChained () const
void | debugChain (const DebugEnabler *chain=0)
void | debugCopy (const DebugEnabler *original=0)
void | debugSet (const char *desc)

## Additional Inherited Members
Static Public Member Functions inherited from GenObject
static void * | getObject (const String &name, const GenObject *obj)
static bool | getObjCounting ()
static void | setObjCounting (bool enable)
static NamedCounter * | getObjCounter (const String &name, bool create=true)
static ObjList & | getObjCounters ()
Protected Member Functions inherited from DebugEnabler
void | debugName (const char *name)

## Detailed Description

Plugin support.

Initialization and information about plugins. Plugins are located in shared libraries that are loaded at runtime.

      // Create static Plugin object by using the provided macro
      INIT_PLUGIN(Plugin);
    *

## Constructor & Destructor Documentation

## ◆ Plugin()

Plugin | ( | const char * | name,
|  | bool | earlyInit = false )
| explicit

Creates a new Plugin container.

Parameters

  name | the undecorated name of the library that contains the plugin
  earlyInit | True to initialize the plugin early

## ◆ ~Plugin()

virtual ~Plugin | ( |  | ) |
| virtual

Destroys the plugin. The destructor must never be called directly - the Loader will do it when the shared object's reference count reaches zero.

## Member Function Documentation

## ◆ earlyInit()

bool earlyInit | ( |  | ) | const
| inline

Check if the module is to be initialized early

Returns
  True if the module should be initialized before regular ones

## ◆ getObject()

virtual void * getObject | ( | const String & | name | ) | 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

Reimplemented from GenObject.

Reimplemented in Driver, and Module.

## ◆ initialize()

virtual void initialize | ( |  | ) |
| pure virtual

Initialize the plugin after it was loaded and registered.

Implemented in ClientDriver, Driver, and Module.

## ◆ isBusy()

virtual bool isBusy | ( |  | ) | const
| inlinevirtual

Check if the module is actively used.

Returns
  True if the plugin is in use, false if should be ok to restart

Reimplemented in Driver.

## ◆ name()

const String & name | ( |  | ) | const
| inline

Retrieve the name of the plugin

Returns
  The plugin's name as String

Referenced by Module::relayId().

## ◆ objectsCounter()

NamedCounter * objectsCounter | ( |  | ) | const
| inline

Retrive the objects counter associated to this plugin

Returns
  Pointer to plugin's objects counter or NULL

## ◆ toString()

virtual const String & toString | ( |  | ) | const
| inlinevirtual

Get a string representation of this object

Returns
  Name of the plugin

Reimplemented from GenObject.

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

- yatengine.h