gloox  1.0.28
Classes | Public Types | Public Member Functions | List of all members
Event Class Reference

#include <pubsubevent.h>

Inheritance diagram for Event:
Inheritance graph
[legend]

Classes

struct  ItemOperation
 

Public Types

typedef std::list< ItemOperation * > ItemOperationList
 

Public Member Functions

 Event ()
 
 Event (const Tag *event)
 
 Event (const std::string &node, PubSub::EventType type)
 
virtual ~Event ()
 
PubSub::EventType type () const
 
const StringListsubscriptions () const
 
const ItemOperationListitems () const
 
void addItem (ItemOperation *op)
 
const std::string & node () const
 
const JIDjid ()
 
bool subscription ()
 
const std::string & filterString () const
 
StanzaExtensionnewInstance (const Tag *tag) const
 
Tagtag () const
 
virtual StanzaExtensionclone () const
 
- Public Member Functions inherited from StanzaExtension
 StanzaExtension (int type)
 
virtual ~StanzaExtension ()
 
virtual StanzaembeddedStanza () const
 
virtual TagembeddedTag () const
 
int extensionType () const
 

Detailed Description

This is an implementation of a PubSub Notification as a StanzaExtension.

Author
Vincent Thomasset vthom.nosp@m.asse.nosp@m.t@gma.nosp@m.il.c.nosp@m.om
Since
1.0

Definition at line 34 of file pubsubevent.h.

Member Typedef Documentation

◆ ItemOperationList

typedef std::list<ItemOperation*> ItemOperationList

A list of ItemOperations.

Definition at line 69 of file pubsubevent.h.

Constructor & Destructor Documentation

◆ Event() [1/3]

Event ( )

PubSub event notification Stanza Extension. This constructor can be used to create an empty instance for registering the StanzaExtension.

Definition at line 39 of file pubsubevent.cpp.

◆ Event() [2/3]

Event ( const Tag event)

PubSub event notification Stanza Extension.

Parameters
eventA tag to parse.

Definition at line 46 of file pubsubevent.cpp.

◆ Event() [3/3]

Event ( const std::string &  node,
PubSub::EventType  type 
)

PubSub event notification Stanza Extension.

Parameters
nodeThe node's ID for which the notification is sent.
typeThe event's type.

Definition at line 148 of file pubsubevent.cpp.

◆ ~Event()

~Event ( )
virtual

Virtual destructor.

Definition at line 157 of file pubsubevent.cpp.

Member Function Documentation

◆ addItem()

void addItem ( ItemOperation op)

Add an item to the list of ItemOperations for EventItems(Retract) notification. After calling, the PubSub::Event object owns the ItemOperation and will free it.

Parameters
opAn ItemOperation to add.

Definition at line 173 of file pubsubevent.cpp.

◆ clone()

StanzaExtension * clone ( ) const
virtual

Returns an identical copy of the current StanzaExtension.

Returns
An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 265 of file pubsubevent.cpp.

◆ filterString()

const std::string & filterString ( ) const
virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
The extension's filter string.

Implements StanzaExtension.

Definition at line 181 of file pubsubevent.cpp.

◆ items()

const ItemOperationList& items ( ) const
inline

Returns the list of ItemOperations for EventItems(Retract) notification.

Returns
The list of ItemOperations.

Definition at line 114 of file pubsubevent.h.

◆ jid()

const JID& jid ( )
inline

Returns the subscribe/unsubscribed JID. Only set for subscription notifications (type() == EventSubscription).

Returns
The affected JID.

Definition at line 135 of file pubsubevent.h.

◆ newInstance()

StanzaExtension* newInstance ( const Tag tag) const
inlinevirtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
Returns
The derived extension's new instance.

Implements StanzaExtension.

Definition at line 148 of file pubsubevent.h.

◆ node()

const std::string& node ( ) const
inline

Returns the node's ID for which the notification is sent.

Returns
The node's ID.

Definition at line 128 of file pubsubevent.h.

◆ subscription()

bool subscription ( )
inline

Returns the subscription state. Only set for subscription notifications (type() == EventSubscription).

Returns
True if the subscription request was approved, false otherwise.

Definition at line 142 of file pubsubevent.h.

◆ subscriptions()

const StringList& subscriptions ( ) const
inline

Returns the list of subscription IDs for which this notification is valid.

Returns
The list of subscription IDs.

Definition at line 107 of file pubsubevent.h.

◆ tag()

Tag * tag ( ) const
virtual

Returns a Tag representation of the extension.

Returns
A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 187 of file pubsubevent.cpp.

◆ type()

PubSub::EventType type ( ) const
inline

Returns the event's type.

Returns
The event's type.

Definition at line 100 of file pubsubevent.h.


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