ariba::utility::Timer Class Reference

#include <source/ariba/utility/system/Timer.h>

Inherits ariba::utility::SystemEventListener.

Inherited by ariba::application::dhttest::DHTTest, ariba::application::pingpong::PingPong, ariba::overlay::BaseOverlay [protected], ariba::overlay::Chord [protected], ariba::overlay::OneHop [protected], ariba::overlay::OverlayBootstrap::WatchdogTimer, ariba::utility::OvlVis::TimedoutIcon, and ariba::utility::PeriodicBroadcast.

Collaboration diagram for ariba::utility::Timer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Timer ()
virtual ~Timer ()
void setInterval (unsigned int millis, bool oneshot=false)
void start ()
void stop ()
void reset ()
bool isRunning ()

Protected Member Functions

virtual void eventFunction ()
virtual void handleSystemEvent (const SystemEvent &event)

Private Member Functions

 use_logging_h (Timer)

Static Private Member Functions

static void threadFunc (Timer *obj)

Private Attributes

boost::thread * timerThread
volatile unsigned int millis
volatile bool running
volatile bool oneshot

Detailed Description

Definition at line 62 of file Timer.h.


Constructor & Destructor Documentation

ariba::utility::Timer::Timer (  ) 

Definition at line 47 of file Timer.cpp.

References running, and timerThread.

ariba::utility::Timer::~Timer (  )  [virtual]

Definition at line 55 of file Timer.cpp.

References stop(), and timerThread.


Member Function Documentation

void ariba::utility::Timer::eventFunction (  )  [protected, virtual]
void ariba::utility::Timer::handleSystemEvent ( const SystemEvent event  )  [protected, virtual]
bool ariba::utility::Timer::isRunning (  ) 

Is the timer already running?

Definition at line 93 of file Timer.cpp.

References running.

void ariba::utility::Timer::reset (  ) 

Reset a running timer and ignore the remaining interval time. Does not fire the timer event and start the timer with a new interval.

Definition at line 84 of file Timer.cpp.

References timerThread.

Referenced by stop().

void ariba::utility::Timer::setInterval ( unsigned int  millis,
bool  oneshot = false 
)
void ariba::utility::Timer::start (  ) 
void ariba::utility::Timer::stop (  ) 
void ariba::utility::Timer::threadFunc ( Timer obj  )  [static, private]
ariba::utility::Timer::use_logging_h ( Timer   )  [private]

Member Data Documentation

volatile unsigned int ariba::utility::Timer::millis [private]

Definition at line 110 of file Timer.h.

Referenced by handleSystemEvent(), start(), and threadFunc().

volatile bool ariba::utility::Timer::oneshot [private]

Definition at line 112 of file Timer.h.

Referenced by handleSystemEvent(), and threadFunc().

volatile bool ariba::utility::Timer::running [private]

Definition at line 111 of file Timer.h.

Referenced by handleSystemEvent(), isRunning(), start(), stop(), threadFunc(), and Timer().

boost::thread* ariba::utility::Timer::timerThread [private]

Definition at line 107 of file Timer.h.

Referenced by reset(), start(), stop(), Timer(), and ~Timer().


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

Generated on Fri Dec 10 11:09:25 2010 for Ariba by  doxygen 1.6.1