Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 10:11:00

0001 //------------------------------------------------------------------------------
0002 // Copyright (c) 2012 by European Organization for Nuclear Research (CERN)
0003 // Author: Lukasz Janyst <ljanyst@cern.ch>
0004 //------------------------------------------------------------------------------
0005 // XRootD is free software: you can redistribute it and/or modify
0006 // it under the terms of the GNU Lesser General Public License as published by
0007 // the Free Software Foundation, either version 3 of the License, or
0008 // (at your option) any later version.
0009 //
0010 // XRootD is distributed in the hope that it will be useful,
0011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 // GNU General Public License for more details.
0014 //
0015 // You should have received a copy of the GNU Lesser General Public License
0016 // along with XRootD.  If not, see <http://www.gnu.org/licenses/>.
0017 //------------------------------------------------------------------------------
0018 
0019 #ifndef __XRD_CL_TRANSPORT_MANAGER_HH__
0020 #define __XRD_CL_TRANSPORT_MANAGER_HH__
0021 
0022 #include <map>
0023 #include <string>
0024 
0025 namespace XrdCl
0026 {
0027   class TransportHandler;
0028 
0029   //----------------------------------------------------------------------------
0030   //! Manage transport handler objects
0031   //----------------------------------------------------------------------------
0032   class TransportManager
0033   {
0034     public:
0035       typedef TransportHandler *(*TransportFactory)();
0036 
0037       //------------------------------------------------------------------------
0038       //! Constructor
0039       //------------------------------------------------------------------------
0040       TransportManager();
0041 
0042       //------------------------------------------------------------------------
0043       // Destructor
0044       //------------------------------------------------------------------------
0045       virtual ~TransportManager();
0046 
0047       //------------------------------------------------------------------------
0048       //! Register a transport factory function for a given protocol
0049       //------------------------------------------------------------------------
0050       bool RegisterFactory( const std::string &protocol,
0051                             TransportFactory   factory );
0052 
0053       //------------------------------------------------------------------------
0054       //! Get a transport handler object for a given protocol
0055       //------------------------------------------------------------------------
0056       TransportHandler *GetHandler( const std::string &protocol );
0057 
0058     private:
0059       typedef std::map<std::string, TransportHandler*> HandlerMap;
0060       typedef std::map<std::string, TransportFactory>  FactoryMap;
0061       HandlerMap  pHandlers;
0062       FactoryMap  pFactories;
0063   };
0064 }
0065 
0066 #endif // __XRD_CL_TRANSPORT_MANAGER_HH__