Poco::Remoting

class TransportManager

Library: Remoting
Package: Transport
Header: Poco/Remoting/TransportManager.h

Description

A TransportManager manages all existing TransportFactory objects.

Member Summary

Member Functions: create, hasFactory, instance, registerFactory, unregisterFactory

Constructors

Destructor

~TransportManager protected

~TransportManager();

Destroys the TransportManager.

Member Functions

create

Transport * create(
    const std::string & protocol
);

Creates a transport for the given protocol. The transport itself is still uninitialized. Call transport->connect(endPoint) to make it usable! Throws an exception if the protocol is unknown

create

Transport * create(
    const std::string & protocol,
    const std::string & endPoint
);

Creates a connected transport for the given protocol. Throws an exception if the protocol is unknown.

hasFactory

bool hasFactory(
    const std::string & protocol
) const;

Returns true if for the protocol a factory was registered.

instance static

static TransportManager & instance();

Returns a reference to the singleton.

registerFactory

void registerFactory(
    const std::string & protocol,
    TransportFactory * pFactory
);

Registers the factory if it doesn't exist yet. Always takes ownership of the pointer.

unregisterFactory

void unregisterFactory(
    const std::string & protocol
);

Removes the factory from the manager. If for the given protocol no factory is found, the error is silently ignored.