IBR-DTNSuite  0.10
ibrcommon::Timer Class Reference

#include <Timer.h>

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

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
 
- Public Member Functions inherited from ibrcommon::JoinableThread
virtual ~JoinableThread ()=0
 
void join (void) throw (ThreadException)
 
bool isRunning (void)
 
void start (int priority=0) throw (ThreadException)
 
void stop () throw ()
 

Static Public Member Functions

static time_t get_current_time ()
 

Protected Member Functions

void run () throw ()
 
void __cancellation () throw ()
 
- Protected Member Functions inherited from ibrcommon::JoinableThread
 JoinableThread (size_t size=DEFAULT_STACKSIZE)
 
- Protected Member Functions inherited from ibrcommon::Thread
virtual ~Thread ()=0
 
void reset () throw (ThreadException)
 
virtual void setup (void) throw ()
 
virtual void finally (void) throw ()
 
bool isFinalized () throw ()
 
bool operator== (const ibrcommon::Thread &other)
 
 Thread (size_t stack=DEFAULT_STACKSIZE)
 
int kill (int sig)
 
void cancel () throw ()
 

Additional Inherited Members

- Static Protected Member Functions inherited from ibrcommon::Thread
static size_t getNumberOfProcessors ()
 
static void yield (void)
 
static void sleep (time_t timeout)
 
static void concurrency (int level)
 
static bool equal (pthread_t thread1, pthread_t thread2)
 
static void * __execute__ (void *obj) throw ()
 

Detailed Description

Definition at line 51 of file Timer.h.

Member Typedef Documentation

typedef size_t ibrcommon::Timer::time_t

Definition at line 54 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 43 of file Timer.cpp.

ibrcommon::Timer::~Timer ( )
virtual

Definition at line 48 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 ( ) throw ()
protectedvirtual

Implements ibrcommon::Thread.

Definition at line 54 of file Timer.cpp.

Timer::time_t ibrcommon::Timer::get_current_time ( )
static
size_t ibrcommon::Timer::getTimeout ( ) const

This method returns the current timeout

Definition at line 80 of file Timer.cpp.

void ibrcommon::Timer::pause ( )

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

Definition at line 74 of file Timer.cpp.

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

void ibrcommon::Timer::reset ( )

This method resets the timer.

Definition at line 68 of file Timer.cpp.

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

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

Definition at line 61 of file Timer.cpp.


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