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

bulkDataReceiver.h

Go to the documentation of this file.
00001 #ifndef _BULKDATA_RECEIVER_H 00002 #define _BULKDATA_RECEIVER_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 <vector> 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 "bulkDataFlowConsumer.h" 00042 00043 #include "bulkDataC.h" 00044 00048 namespace AcsBulkdata 00049 { 00068 template<class TReceiverCallback> 00069 class BulkDataReceiver 00070 { 00071 public: 00072 00076 BulkDataReceiver(); 00077 00081 virtual ~BulkDataReceiver(); 00082 00090 void initialize(); 00091 00100 void createSingleFlow(); 00101 00112 void createMultipleFlows(const char *fepsConfig); 00113 00121 bulkdata::BulkDataReceiverConfig * getReceiverConfig(); 00122 00132 void getFlowCallback(ACE_CString &flowName, TReceiverCallback *&cb_p); 00133 00144 void getFlowCallback(CORBA::ULong flowNumber, TReceiverCallback *&cb_p); 00145 00153 void closeReceiver(); 00154 00161 std::vector<std::string> getFlowNames(); 00162 00170 void setReceiverName(ACE_CString recvName); 00171 00180 void subscribeNotification(ACS::CBvoid_ptr notifCb); 00181 /* 00182 * @throw ACSBulkDataError::AVNotificationMechanismErrorExImpl 00183 */ 00184 void notifySender(const ACSErr::Completion& comp); 00185 00186 private: 00187 00188 typedef ACE_Hash_Map_Manager<ACE_CString, BulkDataFlowConsumer<TReceiverCallback> *, ACE_Null_Mutex> FepObjects; 00189 typedef ACE_Hash_Map_Iterator<ACE_CString, BulkDataFlowConsumer<TReceiverCallback> *, ACE_Null_Mutex> FepObjectsIterator; 00190 00197 void initPartB(); 00198 00205 AVStreams::StreamEndPoint_B_ptr createSepB(); 00206 00216 AVStreams::FlowConsumer_ptr createFepConsumerB(ACE_CString &flowName, AVStreams::protocolSpec protocols, ACE_CString &format); 00217 00218 00227 void addFepToSep(AVStreams::StreamEndPoint_B_ptr locSepB_p,AVStreams::FlowConsumer_ptr locFepB_p); 00228 00235 AVStreams::StreamEndPoint_B_ptr getStreamEndPointB(); 00236 00243 AVStreams::flowSpec * getFepsConfig(); 00244 00251 void deleteFepsB(); 00252 00253 00260 void deleteSepB(); 00261 00262 void deleteAcceptor(); 00263 00264 void closeSocket(); 00265 00274 const char * createFlowSpec(ACE_CString &flowName, 00275 ACE_CString &fepProtocol); 00276 00277 00278 public: 00282 bulkdata::Connection checkFlowCallbacks(); 00283 00284 bulkdata::Connection getSenderConnectionState() 00285 { 00286 return recvConfig_p->connectionState; 00287 } 00288 00289 private: 00290 FepObjects fepMap_m; 00291 00295 TAO_AV_Endpoint_Reactive_Strategy_B <TAO_StreamEndPoint_B,TAO_VDev,AV_Null_MediaCtrl> reactiveStrategy_m; 00296 00297 AVStreams::StreamEndPoint_B_var sepB_p; 00298 00299 struct FepsCfgB 00300 { 00301 ACE_CString fepsFlowname; 00302 ACE_CString fepsFormat; 00303 ACE_CString fepsProtocol; 00304 }; 00305 00306 AVStreams::flowSpec fepsData; 00307 00308 //bulkdata::BulkDataReceiverConfig_var recvConfig_p; 00309 bulkdata::BulkDataReceiverConfig * recvConfig_p; 00310 00311 TAO_StreamEndPoint_B *sepRefCount_p; 00312 00313 CORBA::Boolean closeReceiverFlag; 00314 00315 ACS::CBvoid_ptr locNotifCb_p; 00316 00320 //void operator=(const BulkDataReceiver&); 00321 }; 00322 } 00323 00324 #include "bulkDataReceiver.i" 00325 00326 #endif /* _BULKDATA_RECEIVER_H */

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