SourceForge.net Logo

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

class IOhandler

This class is a sort of wrap-around the sigaction call to set a handler on a given signal. More...

#include <IOhandler.h>

Collaboration diagram for DAQpp::IOhandler:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 IOhandler (int s)
 Constructor.
 ~IOhandler ()
 Destructor.
void Register (void(*f)(void *), void *p)
 Registers to a IOhandler.
void Unregister ()
 Unregister.
void ResetTrg ()
 resets the interrupt handler
void PrepareForData ()
 Prepares to catch interrupts.
double GetNtrg ()
 returns the number of interrupts
bool Data ()
 returns true if a new interrupt has arrived
void WaitForData ()
 waits for an interrupt

Static Public Member Functions

static void gotIO (int)
 actial signal catcher

Private Member Functions

int lock ()
 lock
bool trylock ()
 check if it is locked
int unlock ()
 unlock

Private Attributes

int signum
 Specifies the signal to catch.
double nTrg
 number of signal interrupts
bool newData
 set to true when an interrupt occurs
int sem
 semaphore
struct sigaction actIO
 internal sigaction structure
void(* func )(void *)
 callback function
void * ptr
 pointer

Static Private Attributes

static IOhandlerinstance = 0
 instance


Detailed Description

class IOhandler

This class is a sort of wrap-around the sigaction call to set a handler on a given signal.

One example of use is to register to the SIGIO signal to detect when there is data available


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