CRingDataSink

Name

CRingDataSink -- Data sink that writes to a CRingBuffer

Synopsis


#include <CRingDataSink.h>    
       CRingDataSink : public CDataSink {
      
  CRingDataSink(std::string ringName);
    
  virtual  void putItem(const CRingItem& item);
      virtual  void put(const void* pData, size_t nBytes);
  
};
   

DESCRIPTION

Provides a CDataSink that puts data into a CRingBuffer as with all ring buffer producers, the ring buffer must be local to the system on which the program runs.

METHODS

CRingDataSink(std::string ringName);

Creates a ring data sink object using the ringName as the destination for data. If ringName does not yet exist it is created. If the ring exists and already has a producer, an CErrnoException is thrown with the EACCES errno value.

virtual void putItem(const CRingItem& item);

Inserts the ring item item into the underlying ring buffer. If necessary, this method will block until sufficient free put space is available in the ring buffer.

virtual void put(const void* pData, size_t nBytes);

Inserts nBytes of arbitraty data to the underlying ring. The data inserted are pointed to by pData. If necessary this method blocks untile sufficient free put space is available.