Orbit Framework 2.0.0
A high-performance asynchronous C++20 HTTP server framework.
Loading...
Searching...
No Matches
orbit::server::TimerHandle Class Reference

A timer from App::run_every() or App::run_after(). More...

#include <Timer.hpp>

Public Member Functions

 TimerHandle ()=default
 
void cancel ()
 Stops the timer: no further runs start (one already running finishes).
 
bool active () const
 True until cancelled, or until a run_after() timer has run.
 

Private Member Functions

 TimerHandle (std::shared_ptr< detail::TimerState > state)
 

Private Attributes

std::shared_ptr< detail::TimerState > state_
 

Friends

class Scheduler
 

Detailed Description

A timer from App::run_every() or App::run_after().

Copies refer to the same timer. Dropping every copy does not cancel it; call cancel(). A default-constructed handle refers to no timer.

Constructor & Destructor Documentation

◆ TimerHandle() [1/2]

orbit::server::TimerHandle::TimerHandle ( )
default

◆ TimerHandle() [2/2]

orbit::server::TimerHandle::TimerHandle ( std::shared_ptr< detail::TimerState >  state)
inlineexplicitprivate

Member Function Documentation

◆ active()

bool orbit::server::TimerHandle::active ( ) const

True until cancelled, or until a run_after() timer has run.

◆ cancel()

void orbit::server::TimerHandle::cancel ( )

Stops the timer: no further runs start (one already running finishes).

Friends And Related Symbol Documentation

◆ Scheduler

friend class Scheduler
friend

Member Data Documentation

◆ state_

std::shared_ptr<detail::TimerState> orbit::server::TimerHandle::state_
private

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