ccRTP 2.1.2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes
TPRequest< TOCommand, TOSubscriber > Class Template Reference

Provides a way to request timeouts after a number of milli seconds. More...

#include <TimeoutProvider.h>

Collaboration diagram for TPRequest< TOCommand, TOSubscriber >:
Collaboration graph
[legend]

Public Member Functions

 TPRequest (TOSubscriber tsi, int timeoutMs, const TOCommand &command)
 
bool happensBefore (uint64 t)
 
bool happensBefore (const TPRequest *req)
 
int getMsToTimeout ()
 Number of milli seconds until timeout from when this method is called. More...
 
TOCommand getCommand ()
 
TOSubscriber getSubscriber ()
 
bool operator== (const TPRequest< TOCommand, TOSubscriber > &req)
 Two timeout requests are considered equeal if they have the same subscriber AND command AND time when they occur. More...
 

Private Attributes

TOSubscriber subscriber
 
uint64 when_ms
 
TOCommand command
 

Detailed Description

template<class TOCommand, class TOSubscriber>
class TPRequest< TOCommand, TOSubscriber >

Provides a way to request timeouts after a number of milli seconds.

A command is associated to each timeout.

Modified to use the common c++ library functions and the STL list by Werner Dittmann.

Author
Erik Eliasson, elias.nosp@m.son@.nosp@m.it.kt.nosp@m.h.se, 2003
Werner Dittmann Werne.nosp@m.r.Di.nosp@m.ttman.nosp@m.n@t-.nosp@m.onlin.nosp@m.e.de Represents a request of a "timeout" (delivery of a command to a "timeout receiver" after at least a specified time period).

Slightly modified to use gettimeofday directly.

NOTE: This class is only used internaly.

Author
Erik Eliasson
Werner Dittmann

Definition at line 52 of file TimeoutProvider.h.

Constructor & Destructor Documentation

template<class TOCommand, class TOSubscriber>
TPRequest< TOCommand, TOSubscriber >::TPRequest ( TOSubscriber  tsi,
int  timeoutMs,
const TOCommand &  command 
)
inline

Definition at line 57 of file TimeoutProvider.h.

Member Function Documentation

template<class TOCommand, class TOSubscriber>
TOCommand TPRequest< TOCommand, TOSubscriber >::getCommand ( )
inline

Definition at line 106 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
int TPRequest< TOCommand, TOSubscriber >::getMsToTimeout ( )
inline

Number of milli seconds until timeout from when this method is called.

Definition at line 91 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
TOSubscriber TPRequest< TOCommand, TOSubscriber >::getSubscriber ( )
inline

Definition at line 111 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
bool TPRequest< TOCommand, TOSubscriber >::happensBefore ( uint64  t)
inline
Parameters
tms since Epoch

Definition at line 71 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
bool TPRequest< TOCommand, TOSubscriber >::happensBefore ( const TPRequest< TOCommand, TOSubscriber > *  req)
inline

Definition at line 83 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
bool TPRequest< TOCommand, TOSubscriber >::operator== ( const TPRequest< TOCommand, TOSubscriber > &  req)
inline

Two timeout requests are considered equeal if they have the same subscriber AND command AND time when they occur.

If one of the time is zero then this is a wildcard and matches always.

Definition at line 122 of file TimeoutProvider.h.

Field Documentation

template<class TOCommand, class TOSubscriber>
TOCommand TPRequest< TOCommand, TOSubscriber >::command
private

Definition at line 137 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
TOSubscriber TPRequest< TOCommand, TOSubscriber >::subscriber
private

Definition at line 133 of file TimeoutProvider.h.

template<class TOCommand, class TOSubscriber>
uint64 TPRequest< TOCommand, TOSubscriber >::when_ms
private

Definition at line 134 of file TimeoutProvider.h.


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