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
00119 void dumpStatistics(ACE_Log_Priority level=LM_DEBUG);
00120
00121 protected:
00122
00123 typedef enum {StartState, DataRcvState, StopState, IgnoreDataState } SenderFlowStates;
00124 SenderFlowStates currentState_m;
00125 static const char* state2String[];
00126
00127 AcsBulkdata::BulkDataNTSenderStream *senderStream_m;
00128
00129 SenderFlowConfiguration senderFlowCfg_m;
00130
00131 BulkDataNTSenderFlowCallback *callback_m;
00132 bool releaseCB_m;
00133
00134 AcsBulkdata::BulkDataNTDDSPublisher *ddsPublisher_m;
00135 DDS::Topic *ddsTopic_m;
00136 BulkDataNTWriterListener *writerReaderListener_m;
00137 ACSBulkData::BulkDataNTFrameDataWriter *ddsDataWriter_m;
00138
00139 DDS::Duration_t ackTimeout_m;
00140 void setACKsTimeout(double ACKsTimeout);
00141
00142 double throttling_m;
00143 double throttlingMinFrameTime_m;
00144 void setThrottling(double throttling);
00145
00146
00157 void writeFrame(ACSBulkData::DataType dataType, const unsigned char *param=0, size_t len=0, unsigned int restFrameCount=0, bool waitForACKs=false);
00158
00160 ACSBulkData::BulkDataNTFrame *frame_m;
00161
00163 BulkDataNTSenderFlow();
00165 void operator=(const BulkDataNTSenderFlow&);
00167 BulkDataNTSenderFlow(const BulkDataNTSenderFlow&);
00168 };
00169
00170 };
00171
00172
00173 #endif