Apollo  6.0
Open source self driving car software
Public Member Functions | List of all members
apollo::cyber::Timer Class Reference

Used to perform oneshot or periodic timing tasks. More...

#include <timer.h>

Collaboration diagram for apollo::cyber::Timer:
Collaboration graph

Public Member Functions

 Timer ()
 
 Timer (TimerOption opt)
 Construct a new Timer object. More...
 
 Timer (uint32_t period, std::function< void()> callback, bool oneshot)
 Construct a new Timer object. More...
 
 ~Timer ()
 
void SetTimerOption (TimerOption opt)
 Set the Timer Option object. More...
 
void Start ()
 Start the timer. More...
 
void Stop ()
 Stop the timer. More...
 

Detailed Description

Used to perform oneshot or periodic timing tasks.

Constructor & Destructor Documentation

◆ Timer() [1/3]

apollo::cyber::Timer::Timer ( )

◆ Timer() [2/3]

apollo::cyber::Timer::Timer ( TimerOption  opt)
explicit

Construct a new Timer object.

Parameters
optTimer option

◆ Timer() [3/3]

apollo::cyber::Timer::Timer ( uint32_t  period,
std::function< void()>  callback,
bool  oneshot 
)

Construct a new Timer object.

Parameters
periodThe period of the timer, unit is ms
callbackThe tasks that the timer needs to perform
oneshotTrue: perform the callback only after the first timing cycle False: perform the callback every timed period

◆ ~Timer()

apollo::cyber::Timer::~Timer ( )

Member Function Documentation

◆ SetTimerOption()

void apollo::cyber::Timer::SetTimerOption ( TimerOption  opt)

Set the Timer Option object.

Parameters
optThe timer option will be set

◆ Start()

void apollo::cyber::Timer::Start ( )

Start the timer.

◆ Stop()

void apollo::cyber::Timer::Stop ( )

Stop the timer.


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