Home · Modules · All Classes · All Namespaces
Public Member Functions | Protected Member Functions | List of all members
Tp::StreamTubeServer::ParametersGenerator Class Referenceabstract

The StreamTubeServer::ParametersGenerator abstract interface allows sending a different set of parameters with each tube offer. More...

#include <TelepathyQt/StreamTubeServer>

Inherited by Tp::FixedParametersGenerator.

Public Member Functions

virtual QVariantMap nextParameters (const AccountPtr &account, const OutgoingStreamTubeChannelPtr &tube, const ChannelRequestHints &hints)=0
 

Protected Member Functions

virtual ~ParametersGenerator ()
 

Detailed Description

The StreamTubeServer::ParametersGenerator abstract interface allows sending a different set of parameters with each tube offer.

Tube parameters are arbitrary data sent with the tube offer, which can be retrieved in the receiving end with IncomingStreamTubeChannel::parameters(). They can be used to transfer e.g. session identification information, authentication credentials or alike, for bootstrapping the protocol used for communicating over the tube.

For usecases where the parameters don't need to change between each tube, just passing a fixed set of parameters to a suitable StreamTubeServer::exportTcpSocket() overload is usually more convenient than implementing a ParametersGenerator. Note that StreamTubeServer::exportTcpSocket() can be called multiple times to change the parameters for future tubes when e.g. configuration settings have been changed, so a ParametersGenerator only needs to be implemented if each and every tube must have a different set of parameters.

Constructor & Destructor Documentation

◆ ~ParametersGenerator()

Tp::StreamTubeServer::ParametersGenerator::~ParametersGenerator ( )
inlineprotectedvirtual

Class destructor. Protected, because StreamTubeServer never deletes a ParametersGenerator passed to it.

Member Function Documentation

◆ nextParameters()

QVariantMap Tp::StreamTubeServer::ParametersGenerator::nextParameters ( const AccountPtr &  account,
const OutgoingStreamTubeChannelPtr &  tube,
const ChannelRequestHints hints 
)
pure virtual

Return the parameters to send when offering the given tube.

Parameters
accountThe account from which the tube originates.
tubeThe tube channel which is going to be offered by the StreamTubeServer.
hintsThe hints associated with the request that led to the creation of this tube, if any.
Returns
Parameters to send with the offer, or an empty QVariantMap if none are needed for this tube.