|
xrootd
|
00001 //------------------------------------------------------------------------------ 00002 // Copyright (c) 2011-2012 by European Organization for Nuclear Research (CERN) 00003 // Author: Lukasz Janyst <ljanyst@cern.ch> 00004 //------------------------------------------------------------------------------ 00005 // XRootD is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU Lesser General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // XRootD is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with XRootD. If not, see <http://www.gnu.org/licenses/>. 00017 //------------------------------------------------------------------------------ 00018 00019 #ifndef __XRD_CL_POST_CHANNEL_HH__ 00020 #define __XRD_CL_POST_CHANNEL_HH__ 00021 00022 #include <stdint.h> 00023 #include <vector> 00024 #include <ctime> 00025 00026 #include "XrdCl/XrdClStatus.hh" 00027 #include "XrdCl/XrdClURL.hh" 00028 #include "XrdCl/XrdClPoller.hh" 00029 #include "XrdCl/XrdClInQueue.hh" 00030 #include "XrdCl/XrdClPostMasterInterfaces.hh" 00031 #include "XrdCl/XrdClAnyObject.hh" 00032 #include "XrdCl/XrdClTaskManager.hh" 00033 00034 #include "XrdSys/XrdSysPthread.hh" 00035 00036 namespace XrdCl 00037 { 00038 class Stream; 00039 class JobManager; 00040 00041 //---------------------------------------------------------------------------- 00043 //---------------------------------------------------------------------------- 00044 class Channel 00045 { 00046 public: 00047 //------------------------------------------------------------------------ 00055 //------------------------------------------------------------------------ 00056 Channel( const URL &url, 00057 Poller *poller, 00058 TransportHandler *transport, 00059 TaskManager *taskManager, 00060 JobManager *jobManager ); 00061 00062 //------------------------------------------------------------------------ 00064 //------------------------------------------------------------------------ 00065 ~Channel(); 00066 00067 //------------------------------------------------------------------------ 00069 //------------------------------------------------------------------------ 00070 const URL &GetURL() const 00071 { 00072 return pUrl; 00073 } 00074 00075 //------------------------------------------------------------------------ 00085 //------------------------------------------------------------------------ 00086 Status Send( Message *msg, bool stateful, time_t expires ); 00087 00088 //------------------------------------------------------------------------ 00100 //------------------------------------------------------------------------ 00101 Status Send( Message *msg, 00102 OutgoingMsgHandler *handler, 00103 bool stateful, 00104 time_t expires ); 00105 00106 00107 //------------------------------------------------------------------------ 00117 //------------------------------------------------------------------------ 00118 Status Receive( Message *&msg, MessageFilter *filter, time_t expires ); 00119 00120 //------------------------------------------------------------------------ 00127 //------------------------------------------------------------------------ 00128 Status Receive( IncomingMsgHandler *handler, time_t expires ); 00129 00130 //------------------------------------------------------------------------ 00137 //------------------------------------------------------------------------ 00138 Status QueryTransport( uint16_t query, AnyObject &result ); 00139 00140 //------------------------------------------------------------------------ 00142 //------------------------------------------------------------------------ 00143 void RegisterEventHandler( ChannelEventHandler *handler ); 00144 00145 //------------------------------------------------------------------------ 00147 //------------------------------------------------------------------------ 00148 void RemoveEventHandler( ChannelEventHandler *handler ); 00149 00150 //------------------------------------------------------------------------ 00152 //------------------------------------------------------------------------ 00153 void Tick( time_t now ); 00154 00155 private: 00156 00157 URL pUrl; 00158 Poller *pPoller; 00159 TransportHandler *pTransport; 00160 TaskManager *pTaskManager; 00161 std::vector<Stream *> pStreams; 00162 XrdSysMutex pMutex; 00163 AnyObject pChannelData; 00164 InQueue pIncoming; 00165 Task *pTickGenerator; 00166 JobManager *pJobManager; 00167 }; 00168 } 00169 00170 #endif // __XRD_CL_POST_CHANNEL_HH__
1.7.6.1