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