00001 #ifndef _BULKDATA_SENDER_THREAD_IMPL_H_ 00002 #define _BULKDATA_SENDER_THREAD_IMPL_H_ 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) European Southern Observatory, 2002 00006 * Copyright by ESO (in the framework of the ALMA collaboration) 00007 * and Cosylab 2002, All rights reserved 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU Lesser General Public 00011 * License as published by the Free Software Foundation; either 00012 * version 2.1 of the License, or (at your option) any later version. 00013 * 00014 * This library is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 * Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public 00020 * License along with this library; if not, write to the Free Software 00021 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 * 00023 * 00024 * "@(#)" 00025 * 00026 * who when what 00027 * -------- -------- ---------------------------------------------- 00028 * oat 17/03/08 created 00029 */ 00030 00031 /************************************************************************ 00032 * 00033 *---------------------------------------------------------------------- 00034 */ 00035 00036 #include "bulkDataSenderDistrS.h" 00037 00038 #include "bulkDataSenderImpl.h" 00039 00040 #include "bulkDataSenderDefaultCb.h" 00041 00042 #include <acsThread.h> 00043 00044 #include <vector> 00045 00068 //forward declaration 00069 class BulkDataSenderThreadImpl; 00070 00071 class SenderThread : public ACS::Thread 00072 { 00073 public: 00074 SenderThread(const ACE_CString& name, 00075 BulkDataSenderThreadImpl *sender, 00076 CORBA::ULong flowNumber, 00077 const ACS::TimeInterval& responseTime=ThreadBase::defaultResponseTime, 00078 const ACS::TimeInterval& sleepTime=ThreadBase::defaultSleepTime); 00079 00080 ~SenderThread(); 00081 00082 virtual void run(); 00083 00084 private: 00085 00086 BulkDataSenderThreadImpl *sender_p; 00087 00088 ACE_Message_Block *mb_p; 00089 00090 CORBA::ULong flowNumber_m; 00091 }; 00092 00093 00094 00095 class BulkDataSenderThreadImpl : public virtual BulkDataSenderDefaultImpl, 00096 public virtual POA_bulkdatadistr::BulkDataSenderDistr 00097 { 00098 public: 00099 00100 BulkDataSenderThreadImpl(const ACE_CString& name,maci::ContainerServices* containerServices); 00101 00102 virtual ~BulkDataSenderThreadImpl(); 00103 00107 virtual void startSend(); 00108 00112 virtual void paceData(); 00113 00117 virtual void stopSend(); 00118 00119 private: 00120 00121 CORBA::ULong numberOfFlows; 00122 std::vector<SenderThread*> thread_p; 00123 }; 00124 00125 #endif /* _BULKDATA_SENDER_THREAD_IMPL_H_ */