Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes

AcsBulkdata::StreamerThread Class Reference

#include <bulkDataNTGenStreamerThread.h>

Inheritance diagram for AcsBulkdata::StreamerThread:
Inheritance graph
[legend]
Collaboration diagram for AcsBulkdata::StreamerThread:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StreamerThread (const char *threadName, const std::string &streamName, const std::string &sendFlowName, const std::string &qosLib, const double &throttling, const double &sendTimeout, const double &ACKTimeout)
 ~StreamerThread ()
void send (uint8_t *data, size_t size)
void abort ()
void wait (const char *uid, const ACS::TimeInterval timeout)
void run ()

Private Member Functions

 StreamerThread (const StreamerThread &src)
StreamerThreadoperator= (const StreamerThread &src)

Private Attributes

bool m_isThreadRunning
bool m_isAbort
std::list< std::pair< uint8_t
*, size_t > > 
data_buffers
std::list< std::pair< uint8_t
*, size_t > > 
m_data
sem_t m_dataReadySem
sem_t m_abortReadySem
pthread_mutex_t m_accessMutex
std::string m_streamName
std::string m_sendFlowName
std::string m_qosLib
BulkDataNTSenderStreamm_senderStream
BulkDataNTSenderFlowm_sendFlow
double m_throttling
double m_sendTimeout
double m_ACKTimeout

Static Private Attributes

static const ACS::TimeInterval m_accessTimeout = 50000000LLU

Constructor & Destructor Documentation

AcsBulkdata::StreamerThread::StreamerThread ( const char *  threadName,
const std::string &  streamName,
const std::string &  sendFlowName,
const std::string &  qosLib,
const double &  throttling,
const double &  sendTimeout,
const double &  ACKTimeout 
)

constructor.

AcsBulkdata::StreamerThread::~StreamerThread (  ) 

Destructor flushes remaining data and stops the thread.

AcsBulkdata::StreamerThread::StreamerThread ( const StreamerThread src  )  [private]

Copy constructor is private, it does not make sense to 'copy' one of these threads.


Member Function Documentation

void AcsBulkdata::StreamerThread::abort (  ) 

Stop flow.

StreamerThread& AcsBulkdata::StreamerThread::operator= ( const StreamerThread src  )  [private]

Assigment operator is private, it does not make sense to make one of these threads the same as a second one.

void AcsBulkdata::StreamerThread::run (  )  [virtual]

Get flow number. worker function that handles the incoming data.

Reimplemented from ACS::Thread.

void AcsBulkdata::StreamerThread::send ( uint8_t *  data,
size_t  size 
)

Send data.

void AcsBulkdata::StreamerThread::wait ( const char *  uid,
const ACS::TimeInterval  timeout 
) [inline]

Waits until a given blob is completed or aborted, it simply invokes wait() on base Streamer class which is actually private.


Member Data Documentation

std::list< std::pair<uint8_t *, size_t> > AcsBulkdata::StreamerThread::data_buffers [private]

Abort method waits for thread completion by means of this semaphore.

pthread_mutex_t AcsBulkdata::StreamerThread::m_accessMutex [private]

Data pointers are kept in a container that must be accessed (insert or remove) only while holding this mutex.

const ACS::TimeInterval AcsBulkdata::StreamerThread::m_accessTimeout = 50000000LLU [static, private]

Timeout for guarded access operations.

std::list< std::pair<uint8_t *, size_t> > AcsBulkdata::StreamerThread::m_data [private]

Data to send is kept as a list of pointers to stl vectors. The order in the list is the order in which data should be streamed out.

Data available for retrieval every time this semaphore is available.

Use this flag to signal that the data flow is being aborted.

Use this flag to signal that the thread is being commanded to terminate. Once this flag is unset and the thread gets once more the data-ready semaphore the thread will break its main while-loop.


The documentation for this class was generated from the following file: