XRootD
Loading...
Searching...
No Matches
XrdCl::TransportManager Class Reference

Manage transport handler objects. More...

#include <XrdClTransportManager.hh>

+ Collaboration diagram for XrdCl::TransportManager:

Public Types

typedef TransportHandler *(* TransportFactory) ()
 

Public Member Functions

 TransportManager ()
 Constructor.
 
virtual ~TransportManager ()
 
TransportHandlerGetHandler (const std::string &protocol)
 Get a transport handler object for a given protocol.
 
bool RegisterFactory (const std::string &protocol, TransportFactory factory)
 Register a transport factory function for a given protocol.
 

Detailed Description

Manage transport handler objects.

Definition at line 32 of file XrdClTransportManager.hh.

Member Typedef Documentation

◆ TransportFactory

typedef TransportHandler *(* XrdCl::TransportManager::TransportFactory) ()

Definition at line 35 of file XrdClTransportManager.hh.

Constructor & Destructor Documentation

◆ TransportManager()

XrdCl::TransportManager::TransportManager ( )

Constructor.

Definition at line 27 of file XrdClTransportManager.cc.

28 {
29 pHandlers["root"] = new XRootDTransport();
30 pHandlers["xroot"] = new XRootDTransport();
31 pHandlers["roots"] = new XRootDTransport();
32 pHandlers["xroots"] = new XRootDTransport();
33 }

◆ ~TransportManager()

XrdCl::TransportManager::~TransportManager ( )
virtual

Definition at line 38 of file XrdClTransportManager.cc.

39 {
40 HandlerMap::iterator it;
41 for( it = pHandlers.begin(); it != pHandlers.end(); ++it )
42 delete it->second;
43 }

Member Function Documentation

◆ GetHandler()

TransportHandler * XrdCl::TransportManager::GetHandler ( const std::string & protocol)

Get a transport handler object for a given protocol.

Definition at line 61 of file XrdClTransportManager.cc.

62 {
63 HandlerMap::iterator itH = pHandlers.find( protocol );
64 if( itH != pHandlers.end() )
65 return itH->second;
66
67 FactoryMap::iterator itF = pFactories.find( protocol );
68 if( itF == pFactories.end() )
69 return 0;
70
71 TransportHandler *handler = (*itF->second)();
72 pHandlers[protocol] = handler;
73 return handler;
74 }

Referenced by XrdCl::PostMaster::CollapseRedirect(), and XrdCl::PluginUnloadHandler::UnloadHandler().

+ Here is the caller graph for this function:

◆ RegisterFactory()

bool XrdCl::TransportManager::RegisterFactory ( const std::string & protocol,
TransportFactory factory )

Register a transport factory function for a given protocol.

Definition at line 48 of file XrdClTransportManager.cc.

50 {
51 FactoryMap::iterator it = pFactories.find( protocol );
52 if( it == pFactories.end() )
53 return false;
54 pFactories[protocol] = factory;
55 return true;
56 }

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