gloox  1.0
Public Member Functions | List of all members
StanzaExtensionFactory Class Reference

#include <stanzaextensionfactory.h>

Public Member Functions

void registerExtension (StanzaExtension *ext)
bool removeExtension (int ext)
 StanzaExtensionFactory ()
 ~StanzaExtensionFactory ()
void addExtensions (Stanza &stanza, Tag *tag)

Detailed Description

A Factory that creates StanzaExtensions from Tags.

To supply a custom StanzaExtension, reimplement StanzaExtension's virtuals and pass an instance to registerExtension().

You should not need to use this class directly. Use ClientBase::registerStanzaExtension() instead. See StanzaExtension for more information about adding protocol implementations to gloox.

Author
Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 39 of file stanzaextensionfactory.h.

Constructor & Destructor Documentation

Creates a new StanzaExtensionFactory.

Definition at line 25 of file stanzaextensionfactory.cpp.

Non-virtual destructor.

Definition at line 29 of file stanzaextensionfactory.cpp.

Member Function Documentation

void addExtensions ( Stanza stanza,
Tag tag 
)

This function creates StanzaExtensions from the given Tag and attaches them to the given Stanza.

Parameters
stanzaThe Stanza to attach the extensions to.
tagThe Tag to parse and create the StanzaExtension from.

Definition at line 68 of file stanzaextensionfactory.cpp.

void registerExtension ( StanzaExtension ext)

Use this function to inform StanzaExtensionFactory about available StanzaExtensions. By default, StanzaExtensionFactory does not know about any extensions. gloox-built-in extensions will usually be registered by their respective protocol implementations unless otherwise noted in the extension's API docs.

Parameters
extAn extension to register.
Note
The supplied StanzaExtension will be deleted in StanzaExtensionFactory's destructor.
Only one instance per extension type can be registered. In case an extension is registered that is of the same type as an already registered extension, the new extension will replace the previously registered one.

Definition at line 34 of file stanzaextensionfactory.cpp.

bool removeExtension ( int  ext)

Removes the given extension type.

Parameters
extThe extension type.
Returns
True if the given type was found (and removed), false otherwise.

Definition at line 53 of file stanzaextensionfactory.cpp.


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