Go to the documentation of this file.00001 #ifndef bulkDataNTStreamerThread_H
00002 #define bulkDataNTStreamerThread_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
00029
00030
00031 #ifndef __cplusplus
00032 #error This is a C++ include file and cannot be used from plain C
00033 #endif
00034
00035
00036
00037
00038 #include <pthread.h>
00039 #include <semaphore.h>
00040
00041
00042
00043
00044 #include <acsThread.h>
00045 #include <maciContainerServices.h>
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 #include "bulkDataNTSenderFlow.h"
00056
00060 namespace AcsBulkdata
00061 {
00062 class StreamerThread : public ACS::Thread
00063 {
00064 public:
00067 StreamerThread( const char *threadName,
00068 const std::string & streamName,
00069 const std::string &sendFlowName,
00070 const std::string &qosLib,
00071 const double & throttling,
00072 const double & sendTimeout,
00073 const double & ACKTimeout);
00074
00077 ~StreamerThread();
00078
00081 void send(uint8_t * data, size_t size);
00082
00085
00086 void abort();
00091 void wait(const char *uid, const ACS::TimeInterval timeout)
00092 {
00093
00094
00095 }
00096
00099
00100
00101
00102
00103
00104
00107 void run();
00108
00109
00110 private:
00114 StreamerThread(const StreamerThread &src);
00115
00119 StreamerThread &operator =(const StreamerThread &src);
00120
00126 bool m_isThreadRunning;
00127
00130 bool m_isAbort;
00131
00132 std::list< std::pair<uint8_t *, size_t> > data_buffers;
00133
00138
00139 std::list< std::pair<uint8_t *, size_t> > m_data;
00140
00144 sem_t m_dataReadySem;
00145
00149 sem_t m_abortReadySem;
00150
00155 pthread_mutex_t m_accessMutex;
00156
00159 static const ACS::TimeInterval m_accessTimeout = 50000000LLU;
00160
00161 std::string m_streamName;
00162
00163 std::string m_sendFlowName;
00164
00165 std::string m_qosLib;
00166
00167 BulkDataNTSenderStream * m_senderStream;
00168
00169 BulkDataNTSenderFlow *m_sendFlow;
00170
00171 double m_throttling;
00172
00173 double m_sendTimeout;
00174
00175 double m_ACKTimeout;
00176 };
00177 };
00178
00179 #endif
00180
00181