xrootd
XrdClTransportManager.hh
Go to the documentation of this file.
1 //------------------------------------------------------------------------------
2 // Copyright (c) 2012 by European Organization for Nuclear Research (CERN)
3 // Author: Lukasz Janyst <ljanyst@cern.ch>
4 //------------------------------------------------------------------------------
5 // XRootD is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU Lesser General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // XRootD is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with XRootD. If not, see <http://www.gnu.org/licenses/>.
17 //------------------------------------------------------------------------------
18 
19 #ifndef __XRD_CL_TRANSPORT_MANAGER_HH__
20 #define __XRD_CL_TRANSPORT_MANAGER_HH__
21 
22 #include <map>
23 #include <string>
24 
25 namespace XrdCl
26 {
27  class TransportHandler;
28 
29  //----------------------------------------------------------------------------
31  //----------------------------------------------------------------------------
33  {
34  public:
35  typedef TransportHandler *(*TransportFactory)();
36 
37  //------------------------------------------------------------------------
39  //------------------------------------------------------------------------
41 
42  //------------------------------------------------------------------------
43  // Destructor
44  //------------------------------------------------------------------------
45  virtual ~TransportManager();
46 
47  //------------------------------------------------------------------------
49  //------------------------------------------------------------------------
50  bool RegisterFactory( const std::string &protocol,
51  TransportFactory factory );
52 
53  //------------------------------------------------------------------------
55  //------------------------------------------------------------------------
56  TransportHandler *GetHandler( const std::string &protocol );
57 
58  private:
59  typedef std::map<std::string, TransportHandler*> HandlerMap;
60  typedef std::map<std::string, TransportFactory> FactoryMap;
63  };
64 }
65 
66 #endif // __XRD_CL_TRANSPORT_MANAGER_HH__
Manage transport handler objects.
Definition: XrdClTransportManager.hh:32
Perform the handshake and the authentication for each physical stream.
Definition: XrdClPostMasterInterfaces.hh:302
std::map< std::string, TransportFactory > FactoryMap
Definition: XrdClTransportManager.hh:60
HandlerMap pHandlers
Definition: XrdClTransportManager.hh:61
FactoryMap pFactories
Definition: XrdClTransportManager.hh:62
TransportHandler *(* TransportFactory)()
Definition: XrdClTransportManager.hh:35
bool RegisterFactory(const std::string &protocol, TransportFactory factory)
Register a transport factory function for a given protocol.
TransportHandler * GetHandler(const std::string &protocol)
Get a transport handler object for a given protocol.
std::map< std::string, TransportHandler * > HandlerMap
Definition: XrdClTransportManager.hh:59
TransportManager()
Constructor.