gloox  1.0
Public Member Functions | Protected Member Functions
Component Class Reference

#include <component.h>

Inheritance diagram for Component:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Component (const std::string &ns, const std::string &server, const std::string &component, const std::string &password, int port=5347)
virtual ~Component ()
void disconnect ()

Protected Member Functions

virtual void handleStartNode ()
virtual bool handleNormalNode (Tag *tag)
virtual bool checkStreamVersion (const std::string &)

Detailed Description

This is an implementation of a basic jabber Component.

It's using XEP-0114 (Jabber Component Protocol) to authenticate with a server.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.3

Definition at line 33 of file component.h.


Constructor & Destructor Documentation

Component ( const std::string &  ns,
const std::string &  server,
const std::string &  component,
const std::string &  password,
int  port = 5347 
)

Constructs a new Component.

Parameters:
nsThe namespace that qualifies the stream. Either jabber:component:accept or jabber:component:connect. See XEP-0114 for details.
serverThe server to connect to.
componentThe component's hostname. FQDN.
passwordThe component's password.
portThe port to connect to. The default of 5347 is the default port of the router in jabberd2.

Definition at line 27 of file component.cpp.

virtual ~Component ( ) [inline, virtual]

Virtual Destructor.

Definition at line 52 of file component.h.


Member Function Documentation

virtual bool checkStreamVersion ( const std::string &  version) [inline, protected, virtual]

Implementors of this function can check if they support the advertized stream version. The return value indicates whether or not the stream can be handled. A default implementation is provided.

Parameters:
versionThe advertized stream version.
Returns:
True if the stream can be handled, false otherwise.

Reimplemented from ClientBase.

Definition at line 67 of file component.h.

void disconnect ( ) [inline]

Disconnects from the server.

Definition at line 57 of file component.h.

bool handleNormalNode ( Tag tag) [protected, virtual]

This function is called for each Tag. Only stream initiation/negotiation should be done here.

Parameters:
tagA Tag to handle.

Implements ClientBase.

Definition at line 50 of file component.cpp.

void handleStartNode ( ) [protected, virtual]

This function is called right after the opening <stream:stream> was received.

Implements ClientBase.

Definition at line 35 of file component.cpp.


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