00001 #ifndef _BULK_DATA_NT_SENDER_FLOW_H_ 00002 #define _BULK_DATA_NT_SENDER_FLOW_H_ 00003 /******************************************************************************* 00004 * ALMA - Atacama Large Millimiter Array 00005 * (c) European Southern Observatory, 2011 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * "@(#) $Id: bulkDataNTSenderFlow.h,v 1.11 2011/11/09 16:23:40 bjeram Exp $" 00022 * 00023 * who when what 00024 * -------- -------- ---------------------------------------------- 00025 * bjeram 2011-04-19 created 00026 */ 00027 00028 #ifndef __cplusplus 00029 #error This is a C++ include file and cannot be used from plain C 00030 #endif 00031 00032 #include "bulkDataNTFlow.h" 00033 #include "bulkDataNTDDSPublisher.h" 00034 #include "bulkDataNTSenderStream.h" 00035 #include "bulkDataNTWriterListener.h" 00036 00037 00038 namespace AcsBulkdata 00039 { 00040 00041 class BulkDataNTSenderStream; 00042 00043 class BulkDataNTSenderFlow : public BulkDataNTFlow 00044 { 00045 public: 00046 00050 BulkDataNTSenderFlow(BulkDataNTSenderStream *senderStream, 00051 const char* flowName, 00052 const SenderFlowConfiguration &sndCfg 00053 /*cb*/); 00054 00058 virtual ~BulkDataNTSenderFlow(); 00059 00060 00061 unsigned int getNumberOfReceivers(); 00062 00063 // why do we have default parameter for msg block 00064 void startSend(ACE_Message_Block *param = 0); 00065 00066 /* in old BD was const char now it is unsigned char !!!*/ 00067 void startSend(const unsigned char *param, size_t len); 00068 00069 // const char* -> const unsigned char* (should we add a new method with const char*) 00070 void sendData(const unsigned char *buffer, size_t len); 00071 00072 void stopSend(); 00073 protected: 00074 AcsBulkdata::BulkDataNTSenderStream *senderStream_m; 00075 00076 AcsBulkdata::BulkDataNTDDSPublisher *ddsPublisher_m; 00077 DDS::Topic *ddsTopic_m; 00078 BulkDataNTWriterListener *writerReaderListener_m; 00079 ACSBulkData::BulkDataNTFrameDataWriter *ddsDataWriter_m; 00080 00081 // common method for writing/sending data from startSend and stopSend (could be also used for sendData ?) 00082 // should we add also timeout parameter ? 00083 // should it go to upper class Publisher ? 00084 void writeFrame(ACSBulkData::DataType dataType, const unsigned char *param=0, size_t len=0, unsigned int restFrameCount=0); 00085 00086 // frame 00087 ACSBulkData::BulkDataNTFrame *frame_m; 00088 00090 BulkDataNTSenderFlow(); 00092 void operator=(const BulkDataNTSenderFlow&); 00094 BulkDataNTSenderFlow(const BulkDataNTSenderFlow&); 00095 };//class BulkDataSenderFlow 00096 00097 }; 00098 00099 00100 #endif