Go to the documentation of this file.00001 #ifndef _BULK_DATA_NT_SENDER_FLOW_H_
00002 #define _BULK_DATA_NT_SENDER_FLOW_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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 "bulkDataNTSenderFlowCallback.h"
00036 #include "bulkDataNTWriterListener.h"
00037
00038
00039 namespace AcsBulkdata
00040 {
00041
00042 class BulkDataNTSenderStream;
00043
00044 class BulkDataNTSenderFlow : public BulkDataNTFlow
00045 {
00046 public:
00047
00056 BulkDataNTSenderFlow(BulkDataNTSenderStream *senderStream,
00057 const char* flowName,
00058 const SenderFlowConfiguration &sndCfg,
00059 BulkDataNTSenderFlowCallback *cb,
00060 bool releaseCB );
00061
00065 virtual ~BulkDataNTSenderFlow();
00066
00067
00072 unsigned int getNumberOfReceivers();
00073
00085 void startSend(ACE_Message_Block *param = 0);
00086
00093 void startSend(const unsigned char *param, size_t len);
00094
00101 void sendData(const unsigned char *buffer, size_t len);
00102
00107 void stopSend();
00108
00109 void dumpStatistics();
00110
00111 protected:
00112
00113 typedef enum {StartState, DataRcvState, StopState, IgnoreDataState } SenderFlowStates;
00114 SenderFlowStates currentState_m;
00115 static const char* state2String[];
00116
00117 AcsBulkdata::BulkDataNTSenderStream *senderStream_m;
00118
00119 SenderFlowConfiguration senderFlowCfg_m;
00120
00121 BulkDataNTSenderFlowCallback *callback_m;
00122 bool releaseCB_m;
00123
00124 AcsBulkdata::BulkDataNTDDSPublisher *ddsPublisher_m;
00125 DDS::Topic *ddsTopic_m;
00126 BulkDataNTWriterListener *writerReaderListener_m;
00127 ACSBulkData::BulkDataNTFrameDataWriter *ddsDataWriter_m;
00128
00129 DDS::Duration_t ackTimeout_m;
00130 void setACKsTimeout(double ACKsTimeout);
00131
00132 double throttling_m;
00133 double throttlingMinFrameTime_m;
00134 void setThrottling(double throttling);
00135
00136
00147 void writeFrame(ACSBulkData::DataType dataType, const unsigned char *param=0, size_t len=0, unsigned int restFrameCount=0, bool waitForACKs=false);
00148
00150 ACSBulkData::BulkDataNTFrame *frame_m;
00151
00153 BulkDataNTSenderFlow();
00155 void operator=(const BulkDataNTSenderFlow&);
00157 BulkDataNTSenderFlow(const BulkDataNTSenderFlow&);
00158 };
00159
00160 };
00161
00162
00163 #endif