rambrain
rambrain::Timer Class Reference

Provides an interface to a timer which periodically sends SIGUSR1 signals. More...

#include <timer.h>

Static Public Member Functions

static void startTimer (long seconds, long nanoseconds)
 Start the timer. More...
 
static void stopTimer ()
 Stop the timer. More...
 
static bool isRunning ()
 Simple getter. More...
 

Private Member Functions

 Timer ()
 Create a new timer. More...
 

Static Private Member Functions

static void initialiseTimer ()
 Set up the timer. More...
 

Static Private Attributes

static timer_t timerid
 
static struct sigevent sev
 
static struct itimerspec its
 
static bool initialised = false
 
static bool running = false
 

Detailed Description

Provides an interface to a timer which periodically sends SIGUSR1 signals.

Note
There can always be only one timer in place since it is regulated via static methods

Definition at line 35 of file timer.h.

Constructor & Destructor Documentation

rambrain::Timer::Timer ( )
private

Create a new timer.

Note
Unused

Definition at line 32 of file timer.cpp.

Member Function Documentation

void rambrain::Timer::initialiseTimer ( )
staticprivate

Set up the timer.

Definition at line 66 of file timer.cpp.

static bool rambrain::Timer::isRunning ( )
inlinestatic

Simple getter.

Definition at line 54 of file timer.h.

void rambrain::Timer::startTimer ( long  seconds,
long  nanoseconds 
)
static

Start the timer.

Parameters
secondsHow many seconds until it fires a signal
nanosecondsHow many nanoseconds on top of the seconds until it fires

Definition at line 36 of file timer.cpp.

void rambrain::Timer::stopTimer ( )
static

Stop the timer.

Definition at line 56 of file timer.cpp.

Member Data Documentation

bool rambrain::Timer::initialised = false
staticprivate

Definition at line 74 of file timer.h.

struct itimerspec rambrain::Timer::its
staticprivate

Definition at line 72 of file timer.h.

bool rambrain::Timer::running = false
staticprivate

Definition at line 74 of file timer.h.

struct sigevent rambrain::Timer::sev
staticprivate

Definition at line 71 of file timer.h.

timer_t rambrain::Timer::timerid
staticprivate

Definition at line 70 of file timer.h.


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