Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

bulkDataDistributerImpl.h

Go to the documentation of this file.
00001 #ifndef _BULKDATA_DISTRIBUTER_IMPL_H 00002 #define _BULKDATA_DISTRIBUTER_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 02/03/05 created 00029 */ 00030 00031 /************************************************************************ 00032 * 00033 *---------------------------------------------------------------------- 00034 */ 00035 00036 #ifndef __cplusplus 00037 #error This is a C++ include file and cannot be used from plain C 00038 #endif 00039 00040 #include <baci.h> 00041 #include <baciCharacteristicComponentImpl.h> 00042 #include <maciHelper.h> 00043 #include <maciContainerServices.h> 00044 00045 #include <Pair_T.h> 00046 00047 #include "bulkDataDistributerS.h" 00048 #include "bulkDataDistributer.h" 00049 00050 //#include "bulkDataReceiverS.h" 00051 00052 #include "ACSBulkDataStatus.h" 00053 00054 //forward declaration 00055 template<class TReceiverCallback, class TSenderCallback> 00056 class BulkDataDistributerNotifCb; 00057 00080 template<class TReceiverCallback, class TSenderCallback = BulkDataSenderDefaultCallback> 00081 class BulkDataDistributerImpl : public baci::CharacteristicComponentImpl, 00082 public virtual POA_bulkdata::BulkDataDistributer 00083 { 00084 typedef ACE_Pair< bulkdata::BulkDataReceiver_ptr, AcsBulkdata::BulkDataSender<TSenderCallback> *> Sender_Map_Pair; 00085 00086 typedef ACE_Hash_Map_Manager <ACE_CString, Sender_Map_Pair, ACE_Null_Mutex> Sender_Map; 00087 typedef ACE_Hash_Map_Entry <ACE_CString, Sender_Map_Pair > Sender_Map_Entry; 00088 typedef ACE_Hash_Map_Iterator <ACE_CString, Sender_Map_Pair ,ACE_Null_Mutex> Sender_Map_Iterator; 00089 00090 public: 00091 00097 BulkDataDistributerImpl(const ACE_CString& name,maci::ContainerServices* containerServices); 00098 00102 virtual ~BulkDataDistributerImpl(); 00103 00104 /* 00105 * @throw ACSErr::ACSbaseExImpl 00106 */ 00107 virtual void initialize(); 00108 00109 virtual void cleanUp(); 00110 00111 00112 /********************* Sender part ********************/ 00113 00123 virtual void connect(bulkdata::BulkDataReceiver_ptr receiverObj_p); 00124 00125 00135 virtual void multiConnect(bulkdata::BulkDataReceiver_ptr receiverObj_p); 00136 00146 virtual void connectByName(const char *receiverName_p); 00147 00148 /* 00149 * @throw ACSBulkDataError::AVDisconnectErrorEx 00150 */ 00151 virtual void disconnect(); 00152 00153 /* 00154 * @throw ACSBulkDataError::AVDisconnectErrorEx 00155 */ 00156 virtual void multiDisconnect(bulkdata::BulkDataReceiver_ptr receiverObj_p); 00157 00158 /* 00159 * @throw ACSBulkDataError::AVDisconnectErrorEx 00160 */ 00161 virtual void disconnectByName(const char *receiverName_p); 00162 00163 00172 virtual void startSend(); 00173 00184 virtual void paceData(); 00185 00194 virtual void stopSend(); 00195 00196 /************************ Receiver part ********************/ 00197 00209 virtual void openReceiver(); 00210 00211 /* 00212 * @throw ACSBulkDataError::AVReceiverConfigErrorEx 00213 */ 00214 bulkdata::BulkDataReceiverConfig * getReceiverConfig(); 00215 00216 /* 00217 * @throw ACSBulkDataError::AVCloseReceiverErrorEx 00218 */ 00219 virtual void closeReceiver(); 00220 00221 /* 00222 * @throw ACSBulkDataError::AVSetReceiverErrorEx 00223 */ 00224 virtual void setReceiver(const bulkdata::BulkDataReceiverConfig &receiverConfig); 00225 00226 //protected: 00227 00228 virtual AcsBulkdata::BulkDataDistributer<TReceiverCallback, TSenderCallback> *getDistributer() 00229 { 00230 return &distributer; 00231 } 00232 00233 /* 00234 * @throw ACSBulkDataError::AVInvalidFlowNumberEx 00235 * @throw ACSBulkDataError::AVFlowEndpointErrorEx 00236 */ 00237 virtual ACSErr::Completion *getCbStatus(CORBA::ULong flowNumber); 00238 00239 virtual ACSErr::Completion *getReceiverCbStatus(const char *recvName, CORBA::ULong flowNumber); 00240 00241 /* 00242 * @throw ACSBulkDataError::AVInvalidFlowNumberEx 00243 */ 00244 virtual void setTimeout(CORBA::ULong flowNumber, CORBA::ULong timeout) 00245 { 00246 //empty 00247 } 00248 00249 /* 00250 * @throw ACSBulkDataError::AVSetReceiverNameErrorEx 00251 */ 00252 virtual void setRecvName(const char *recvName) 00253 { 00254 //empty 00255 } 00256 00257 /* 00258 * @throw ACSBulkDataError::AVNotificationMechanismErrorEx 00259 */ 00260 virtual void subscribeNotification(ACS::CBvoid_ptr notifCb); 00261 00262 00263 private: 00264 00265 maci::ContainerServices *containerServices_p; 00266 CDB::DAL_ptr dal_p; 00267 00268 AcsBulkdata::BulkDataDistributer<TReceiverCallback, TSenderCallback> distributer; 00269 00270 void rmEntryFromSenderMap(bulkdata::BulkDataReceiver_ptr receiverObj_p); 00271 void rmEntryFromSenderMap(const char *receiverName_p); 00272 }; 00273 00274 00275 00276 #include "bulkDataDistributerImpl.i" 00277 00278 #endif

Generated on Thu Apr 30 02:30:50 2009 for ACS C++ API by doxygen 1.3.8