Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends | List of all members
roswrap::Timer Class Reference

Manages a timer callback. More...

#include <timer.h>

Classes

class  Impl
 

Public Member Functions

bool hasPending ()
 Returns whether or not the timer has any pending events to call. More...
 
bool isValid ()
 
 operator void * ()
 
bool operator!= (const Timer &rhs)
 
bool operator< (const Timer &rhs)
 
bool operator== (const Timer &rhs)
 
void setPeriod (const Duration &period, bool reset=true)
 Set the period of this timer. More...
 
void start ()
 Start the timer. Does nothing if the timer is already started. More...
 
void stop ()
 Stop the timer. Once this call returns, no more callbacks will be called. Does nothing if the timer is already stopped. More...
 
 Timer ()
 
 Timer (const Timer &rhs)
 
 ~Timer ()
 

Private Types

typedef std::shared_ptr< ImplImplPtr
 
typedef std::weak_ptr< ImplImplWPtr
 

Private Member Functions

 Timer (const TimerOptions &ops)
 

Private Attributes

ImplPtr impl_
 

Friends

class NodeHandle
 

Detailed Description

Manages a timer callback.

A Timer should always be created through a call to NodeHandle::createTimer(), or copied from one that was. Once all copies of a specific Timer go out of scope, the callback associated with that handle will stop being called.

Definition at line 47 of file timer.h.

Member Typedef Documentation

◆ ImplPtr

typedef std::shared_ptr<Impl> roswrap::Timer::ImplPtr
private

Definition at line 119 of file timer.h.

◆ ImplWPtr

typedef std::weak_ptr<Impl> roswrap::Timer::ImplWPtr
private

Definition at line 120 of file timer.h.

Constructor & Destructor Documentation

◆ Timer() [1/3]

roswrap::Timer::Timer ( )
inline

Definition at line 50 of file timer.h.

◆ Timer() [2/3]

roswrap::Timer::Timer ( const Timer rhs)

Definition at line 102 of file timer.cpp.

◆ ~Timer()

roswrap::Timer::~Timer ( )

Definition at line 107 of file timer.cpp.

◆ Timer() [3/3]

roswrap::Timer::Timer ( const TimerOptions ops)
private

Definition at line 91 of file timer.cpp.

Member Function Documentation

◆ hasPending()

bool roswrap::Timer::hasPending ( )

Returns whether or not the timer has any pending events to call.

Definition at line 127 of file timer.cpp.

◆ isValid()

bool roswrap::Timer::isValid ( )
inline

Definition at line 75 of file timer.h.

◆ operator void *()

roswrap::Timer::operator void * ( )
inline

Definition at line 76 of file timer.h.

◆ operator!=()

bool roswrap::Timer::operator!= ( const Timer rhs)
inline

Definition at line 88 of file timer.h.

◆ operator<()

bool roswrap::Timer::operator< ( const Timer rhs)
inline

Definition at line 78 of file timer.h.

◆ operator==()

bool roswrap::Timer::operator== ( const Timer rhs)
inline

Definition at line 83 of file timer.h.

◆ setPeriod()

void roswrap::Timer::setPeriod ( const Duration period,
bool  reset = true 
)

Set the period of this timer.

Parameters
resetWhether to reset the timer. If true, timer ignores elapsed time and next cb occurs at now()+period

Definition at line 137 of file timer.cpp.

◆ start()

void roswrap::Timer::start ( )

Start the timer. Does nothing if the timer is already started.

Definition at line 111 of file timer.cpp.

◆ stop()

void roswrap::Timer::stop ( )

Stop the timer. Once this call returns, no more callbacks will be called. Does nothing if the timer is already stopped.

Definition at line 119 of file timer.cpp.

Friends And Related Function Documentation

◆ NodeHandle

friend class NodeHandle
friend

Definition at line 124 of file timer.h.

Member Data Documentation

◆ impl_

ImplPtr roswrap::Timer::impl_
private

Definition at line 122 of file timer.h.


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


sick_scan_xd
Author(s): Michael Lehning , Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:15