The NSCL DAQ data flow software is based on single producer multi-client ring buffers. A ring buffer is a block of memory that is treated as a circular buffer. NSCL DAQ ring buffers are located in POSIX shared memory regions. They feature a single put pointer and several get pointers.
Ring buffers of this type are an extremely low over head inter process communications mechanism. In most cases you will not need to interact directly with NSCL DAQ Ring buffers. Higher level classes and functions built on top of them will interact for you.
This chapter describes:
The steps you need to follow to compile and link to the ring buffer library.
The general flavor of the ring buffer classes along with sample code.
Reference material can be found in the CRingBuffer reference page
The low level ring buffer software is described in a single header file CRingBuffer.h. This header defines the class, data structures and constants needed to write applications that use the ring buffer primitives.
The header is installed in the include subdirectory of the NSCL DAQ installation tree. Suppose there is an environment variable DAQROOT whose value is the top level installation directory of NSCL DAQ. A sample compilation line might be:
Where consumer.cpp will have:
To link ring buffer programs, you need to specify that the compile-time and run-time linker search the lib subdirectory of the nscldaq installation and incorporate the libDataFlow library: