gloox  0.9.9.12
Public Member Functions | List of all members
InBandBytestream Class Reference

#include <inbandbytestream.h>

Inheritance diagram for InBandBytestream:
Inheritance graph
[legend]
Collaboration diagram for InBandBytestream:
Collaboration graph
[legend]

Public Member Functions

virtual ~InBandBytestream ()
bool isOpen () const
bool sendBlock (const std::string &data)
const std::string & sid () const
int blockSize () const
void registerInBandBytestreamDataHandler (InBandBytestreamDataHandler *ibbdh)
void removeInBandBytestreamDataHandler ()
virtual void decorate (Tag *tag)
virtual void filter (Stanza *stanza)
- Public Member Functions inherited from MessageFilter
 MessageFilter (MessageSession *parent)
virtual ~MessageFilter ()
virtual void attachTo (MessageSession *session)

Detailed Description

An implementation of a single In-Band Bytestream (XEP-0047).

One instance of this class handles one byte stream. You can attach as many InBandBytestream objects to a MessageSession as you like.

See InBandBytestreamManager for a detailed description on how to implement In-Band Bytestreams.

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

Definition at line 39 of file inbandbytestream.h.

Constructor & Destructor Documentation

~InBandBytestream ( )
virtual

Virtual destructor.

Definition at line 33 of file inbandbytestream.cpp.

Member Function Documentation

int blockSize ( ) const
inline

Lets you retrieve this bytestream's block-size.

Returns
The bytestream's block-size.

Definition at line 77 of file inbandbytestream.h.

void decorate ( Tag tag)
virtual

This function receives a message right before it is sent out (there may be other filters which get to see the message after this filter, though).

Parameters
tagThe tag to decorate. It contains the message to be sent.

Implements MessageFilter.

Definition at line 42 of file inbandbytestream.cpp.

void filter ( Stanza stanza)
virtual

This function receives a message stanza right after it was received (there may be other filters which got to see the stanza before this filter, though).

Parameters
stanzaThe complete message stanza.

Implements MessageFilter.

Definition at line 46 of file inbandbytestream.cpp.

bool isOpen ( ) const
inline

Returns whether the bytestream is open, that is, accepted by both parties.

Returns
Whether the bytestream is open or not.

Definition at line 53 of file inbandbytestream.h.

void registerInBandBytestreamDataHandler ( InBandBytestreamDataHandler ibbdh)

Use this function to register an object that will receive any notifications from the InBandBytestream instance. Only one InBandBytestreamDataHandler can be registered at any one time.

Parameters
ibbdhThe InBandBytestreamDataHandler-derived object to receive notifications.

Definition at line 149 of file inbandbytestream.cpp.

void removeInBandBytestreamDataHandler ( )

Removes the registered InBandBytestreamDataHandler.

Definition at line 154 of file inbandbytestream.cpp.

bool sendBlock ( const std::string &  data)

Use this function to send a chunk of data over an open byte stream. The negotiated block size is enforced. If the block is larger, nothing is sent and false is returned. If the stream is not open or has been closed again (by the remote entity or locally), nothing is sent and false is returned. This function does the necessary base64 encoding for you.

Parameters
dataThe block of data to send.
Returns
True if the data has been sent (no guarantee of receipt), false in case of an error.

Definition at line 93 of file inbandbytestream.cpp.

const std::string& sid ( ) const
inline

Lets you retrieve the stream's ID.

Returns
The stream's ID.

Definition at line 71 of file inbandbytestream.h.


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