SourceForge.net Logo

DAQpp::FIFO Class Reference
[DAQ++ IO tools]

class FIFO. More...

#include <Fifo.h>

Inheritance diagram for DAQpp::FIFO:

Inheritance graph
[legend]
Collaboration diagram for DAQpp::FIFO:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 FIFO (int size)
 constructor
 ~FIFO ()
 destructor
int size () const
 returns the size of the fifo
bool empty ()
 tells if the fifo is empty
int read (char *buf, int)
 reads from the fifo
int write (char *buf, int, bool force=false)
 writes to the fifo If force is false, the data will be lost when there is not enough space in the buffer.
void reset ()
 resets the fifo
int space_left ()
 Returns the space left in the FIFO buffer.
int data_available ()
 Returns the ammount of data not yet read from the FIFO.

Private Attributes

DataCondition condition
 The data condition.
int bfsiz
 buffer size
char * buff
 buffer
char * rdptr
 read pointer
char * wrptr
 write pointer
char * end
 End of the buffer.

Classes

class  DataCondition
 Condition flagging data availavility. More...


Detailed Description

class FIFO.

This class implements a fifo. It can be used as a data communication channel between different threads, for instance the RunManager::writeData() and a data logger.


Member Function Documentation

int FIFO::write ( char *  buf,
int  count,
bool  force = false 
)

writes to the fifo If force is false, the data will be lost when there is not enough space in the buffer.

If force is true, the Fifo buffer will be enlarged to ensure that this block of data is not lost

References DAQpp::Mutex::acquire(), bfsiz, buff, condition, end, DAQpp::Condition::notify(), rdptr, DAQpp::Mutex::release(), space_left(), and wrptr.


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

Generated on Mon Apr 21 10:00:04 2008 for DAQ++ by  doxygen 1.5.5