IBR-DTNSuite  0.8
ibrcommon::Timer Class Reference

#include <Timer.h>

Inheritance diagram for ibrcommon::Timer:
Collaboration diagram for ibrcommon::Timer:

List of all members.

Classes

class  StopTimerException

Public Types

typedef size_t time_t

Public Member Functions

 Timer (TimerCallback &callback, size_t timeout=0)
virtual ~Timer ()
void set (size_t timeout)
void reset ()
void pause ()
size_t getTimeout () const

Static Public Member Functions

static time_t get_current_time ()

Protected Member Functions

void run ()
void __cancellation ()

Detailed Description

Definition at line 34 of file Timer.h.


Member Typedef Documentation

typedef size_t ibrcommon::Timer::time_t

Definition at line 37 of file Timer.h.


Constructor & Destructor Documentation

ibrcommon::Timer::Timer ( TimerCallback callback,
size_t  timeout = 0 
)

Constructor for this timer

Parameters:
timeoutTimeout in seconds

Definition at line 29 of file Timer.cpp.

ibrcommon::Timer::~Timer ( ) [virtual]

Definition at line 34 of file Timer.cpp.

References ibrcommon::JoinableThread::join(), and ibrcommon::JoinableThread::stop().

Here is the call graph for this function:


Member Function Documentation

void ibrcommon::Timer::__cancellation ( ) [protected, virtual]

Implements ibrcommon::Thread.

Definition at line 40 of file Timer.cpp.

References ibrcommon::Conditional::abort(), and ibrcommon::StatefulConditional< T, block >::setState().

Here is the call graph for this function:

size_t ibrcommon::Timer::getTimeout ( ) const

This method returns the current timeout

Definition at line 66 of file Timer.cpp.

This method stops the timer. Use reset() to start it again.

Definition at line 60 of file Timer.cpp.

References ibrcommon::StatefulConditional< T, block >::setState().

Referenced by dtn::core::WallClock::componentDown(), dtn::daemon::StatisticLogger::componentDown(), and dtn::api::ApiServer::componentDown().

Here is the call graph for this function:

This method resets the timer.

Definition at line 54 of file Timer.cpp.

References ibrcommon::StatefulConditional< T, block >::setState().

Referenced by dtn::core::WallClock::componentUp().

Here is the call graph for this function:

void ibrcommon::Timer::set ( size_t  timeout)

Definition at line 47 of file Timer.cpp.

References ibrcommon::StatefulConditional< T, block >::setState().

Referenced by dtn::daemon::StatisticLogger::componentUp().

Here is the call graph for this function:


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