SPAOP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
wonder::ConnectionTimer Class Referenceabstract

An interface defining a cyclic timer (to be used as a watchdog for connection timeouts) along with listener and factory interfaces. More...

#include <ConnectionTimer.h>

Inheritance diagram for wonder::ConnectionTimer:
Inheritance graph
[legend]

Classes

class  Factory
 An interface for a factory class that creates ConnectionTimers. More...
 
class  Listener
 A listener that must be notified by the timer on timeout. More...
 

Public Member Functions

virtual ~ConnectionTimer ()
 Destructor. More...
 
virtual void setListener (Listener *listener)=0
 Sets the listener whose timeout() method must be called when the timer runs out. More...
 
virtual void start ()=0
 Starts the timer. More...
 
virtual void stop ()=0
 Stops the timer. More...
 

Detailed Description

An interface defining a cyclic timer (to be used as a watchdog for connection timeouts) along with listener and factory interfaces.

The actual timer implementation must be done in a derived class.

Constructor & Destructor Documentation

virtual wonder::ConnectionTimer::~ConnectionTimer ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual void wonder::ConnectionTimer::setListener ( Listener listener)
pure virtual

Sets the listener whose timeout() method must be called when the timer runs out.

Parameters
listenerThe listener whose timeout() method must be called when the timer runs out.

Implemented in wonderjuce::JuceConnectionTimer.

virtual void wonder::ConnectionTimer::start ( )
pure virtual

Starts the timer.

Once started, the timer must repeatedly call its listener's timeout() method after every timer interval. (A cyclic timer, not a one-shot timer.) In case a timer was stopped and restarted, the timer must act as if it was restarted (meaning the first call to timeout() will happen after a full timer interval has passed).

Implemented in wonderjuce::JuceConnectionTimer.

virtual void wonder::ConnectionTimer::stop ( )
pure virtual

Stops the timer.

Implemented in wonderjuce::JuceConnectionTimer.