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

bulkDataSender.h

Go to the documentation of this file.
00001 #ifndef _BULKDATA_SENDER_H 00002 #define _BULKDATA_SENDER_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 27/01/05 created 00029 */ 00030 00031 #include <iostream> 00032 00033 #include "orbsvcs/AV/AVStreams_i.h" 00034 #include "orbsvcs/AV/Endpoint_Strategy.h" 00035 #include "orbsvcs/AV/Protocol_Factory.h" 00036 #include "orbsvcs/AV/Flows_T.h" 00037 #include "orbsvcs/AV/Transport.h" 00038 #include "orbsvcs/AV/Policy.h" 00039 00040 #include "ACSBulkDataError.h" 00041 #include "bulkDataSenderDefaultCb.h" 00042 #include "bulkDataFlowProducer.h" 00043 00044 #include "bulkDataC.h" 00045 00046 // #include "ace/High_Res_Timer.h" 00047 00048 // #include <acsQoS.h> 00049 00053 namespace AcsBulkdata 00054 { 00074 template<class TSenderCallback> 00075 class BulkDataSender 00076 { 00077 public: 00078 00082 BulkDataSender(); 00083 00087 virtual ~BulkDataSender(); 00088 00096 void initialize(); 00097 00106 void createSingleFlow(); 00107 00118 void createMultipleFlows(const char *fepsConfig); 00119 00128 void connectToPeer(bulkdata::BulkDataReceiverConfig *recvConfig_p); 00129 00140 void getFlowProtocol(ACE_CString &flowname, TAO_AV_Protocol_Object *&currentProtocol_p); 00141 00152 void startSend(CORBA::ULong flownumber, ACE_Message_Block *param = 0); 00153 00164 void startSend(CORBA::ULong flownumber, const char *param, size_t len); 00165 00176 void sendData(CORBA::ULong flownumber, ACE_Message_Block *buffer); 00177 00190 void sendData(CORBA::ULong flownumber, const char *buffer, size_t len); 00191 00202 void stopSend(CORBA::ULong flownumber); 00203 00211 void disconnectPeer(); 00212 00213 TAO_StreamCtrl * getStreamCtrl() 00214 { 00215 return streamctrl_p; 00216 } 00217 00218 const char *getFlowSpec(const ACE_CString & flowName); 00219 00226 std::vector<std::string> getFlowNames(); 00227 00228 /* THE FOLLOWING METHODS ARE UNDER TESTING - PLEASE DO NOT USE THEM */ 00229 /********************************************************************/ 00230 00231 void startStream(CORBA::ULong flownumber); 00232 00233 void sendStream(CORBA::ULong flownumber, ACE_Message_Block *buffer); 00234 00235 void stopStream(CORBA::ULong flownumber); 00236 00237 /********************************************************************/ 00238 00239 00240 private: 00241 00242 typedef ACE_Hash_Map_Manager<ACE_CString, BulkDataFlowProducer<TSenderCallback> *, ACE_Null_Mutex> FepObjects; 00243 typedef ACE_Hash_Map_Iterator<ACE_CString, BulkDataFlowProducer<TSenderCallback> *, ACE_Null_Mutex> FepObjectsIterator; 00244 00245 00252 void initPartA(); 00253 00260 AVStreams::StreamEndPoint_A_ptr createSepA(); 00261 00271 AVStreams::FlowProducer_ptr createFepProducerA(ACE_CString &flowname, 00272 AVStreams::protocolSpec protocols, 00273 ACE_CString &format, 00274 TAO_StreamCtrl *strctrl_p); 00275 00276 00285 void addFepToSep(AVStreams::StreamEndPoint_A_ptr locSepA_p, AVStreams::FlowProducer_ptr locFepA_p); 00286 00287 00294 TAO_StreamCtrl *createStreamCtrl(); 00295 00296 00303 // AVStreams::streamQoS * create_QoS(); 00304 00305 00319 const char * createFwdFlowSpec(ACE_CString &flowname, 00320 ACE_CString &direction, 00321 ACE_CString &formatName, 00322 ACE_CString &flowProtocol, 00323 ACE_CString &carrierProtocol, 00324 ACE_CString &localAddress, 00325 ACE_CString &remoteAddress); 00326 00327 00335 void setReceiverConfig(bulkdata::BulkDataReceiverConfig *recvConfig_p); 00336 00337 00338 00345 AVStreams::StreamEndPoint_A_ptr getStreamEndPointA(); 00346 00347 00354 void deleteStreamCtrl(); 00355 00356 00357 00364 void deleteFepsA(); 00365 00372 void deleteSepA(); 00373 00374 void deleteConnector(); 00375 00376 void deleteHandler(); 00377 00386 const char * createFlowSpec(ACE_CString &flowname, 00387 ACE_CString &fepProtocol); 00388 00389 void mergeFlowSpecs(); 00390 00394 TAO_AV_Endpoint_Reactive_Strategy_A<TAO_StreamEndPoint_A,TAO_VDev,AV_Null_MediaCtrl> endpointStrategy_m; 00395 00396 AVStreams::StreamEndPoint_A_var sepA_p; 00397 00398 AVStreams::StreamEndPoint_B_var sepB_p; 00399 00400 00401 //AVStreams::streamQoS_var the_qos; 00402 struct FepsCfgA 00403 { 00404 ACE_CString fepsFlowname; 00405 ACE_CString fepsFormat; 00406 ACE_CString fepsProtocol; 00407 }; 00408 00409 FepObjects fepMap_m; 00410 00411 AVStreams::flowSpec_var recvFeps_p; 00412 00413 AVStreams::flowSpec senderFeps_m; 00414 00415 00416 TAO_StreamEndPoint_A * sepRefCount_p; 00417 00418 CORBA::Boolean disconnectPeerFlag; 00419 00420 AVStreams::flowSpec flowSpec_m; 00421 TAO_StreamCtrl *streamctrl_p; 00422 00426 //void operator=(const BulkDataSender&); 00427 00428 // public: 00429 // this part should be private 00430 // deprecated and back-incompatible 00431 // needed for the distributer but will be removed as soon as possible 00432 // 00433 // AVStreams::flowSpec flowSpec_m; 00434 // TAO_StreamCtrl *streamctrl_p; 00435 }; 00436 } 00437 00438 #include "bulkDataSender.i" 00439 00440 #endif /* _BULKDATA_SENDER_H */

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