gloox  1.0.28
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 Schröter js@ca.nosp@m.maya.nosp@m..net
Since
0.9

Definition at line 41 of file stanzaextensionfactory.h.

Constructor & Destructor Documentation

◆ StanzaExtensionFactory()

Creates a new StanzaExtensionFactory.

Definition at line 26 of file stanzaextensionfactory.cpp.

◆ ~StanzaExtensionFactory()

Non-virtual destructor.

Definition at line 30 of file stanzaextensionfactory.cpp.

Member Function Documentation

◆ addExtensions()

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 73 of file stanzaextensionfactory.cpp.

◆ registerExtension()

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 37 of file stanzaextensionfactory.cpp.

◆ removeExtension()

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 57 of file stanzaextensionfactory.cpp.


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