Kagome
Polkadot Runtime Engine in C++17
kagome::clock::BasicWaitableTimer Class Reference

#include <basic_waitable_timer.hpp>

Inheritance diagram for kagome::clock::BasicWaitableTimer:
Collaboration diagram for kagome::clock::BasicWaitableTimer:

Public Member Functions

 BasicWaitableTimer (std::shared_ptr< boost::asio::io_context > io_context)
 
 ~BasicWaitableTimer () override=default
 
void expiresAt (clock::SystemClock::TimePoint at) override
 
void expiresAfter (clock::SystemClock::Duration duration) override
 
void cancel () override
 
void asyncWait (const std::function< void(const std::error_code &)> &h) override
 
- Public Member Functions inherited from kagome::clock::Timer
virtual ~Timer ()=default
 

Private Attributes

std::shared_ptr< boost::asio::io_context > io_context_
 
boost::asio::basic_waitable_timer< std::chrono::system_clock > timer_
 

Detailed Description

Implementation of timer over boost::asio::basic_waitable_timer

Definition at line 17 of file basic_waitable_timer.hpp.

Constructor & Destructor Documentation

kagome::clock::BasicWaitableTimer::BasicWaitableTimer ( std::shared_ptr< boost::asio::io_context >  io_context)
explicit

Definition at line 9 of file basic_waitable_timer.cpp.

kagome::clock::BasicWaitableTimer::~BasicWaitableTimer ( )
overridedefault

Member Function Documentation

void kagome::clock::BasicWaitableTimer::asyncWait ( const std::function< void(const std::error_code &)> &  h)
overridevirtual

Wait for the timer expiration

Parameters
h- handler, which is called, when the timer is expired, or error happens

Implements kagome::clock::Timer.

Definition at line 30 of file basic_waitable_timer.cpp.

void kagome::clock::BasicWaitableTimer::cancel ( )
overridevirtual

Cancel timer

Implements kagome::clock::Timer.

Definition at line 26 of file basic_waitable_timer.cpp.

void kagome::clock::BasicWaitableTimer::expiresAfter ( clock::SystemClock::Duration  duration)
overridevirtual

Set an expire time for this timer

Parameters
durationbefore timer will be expired

Implements kagome::clock::Timer.

Definition at line 22 of file basic_waitable_timer.cpp.

void kagome::clock::BasicWaitableTimer::expiresAt ( clock::SystemClock::TimePoint  at)
overridevirtual

Set an expire time for this timer

Parameters
at- timepoint, at which the timer expires

Implements kagome::clock::Timer.

Definition at line 18 of file basic_waitable_timer.cpp.

Member Data Documentation

std::shared_ptr<boost::asio::io_context> kagome::clock::BasicWaitableTimer::io_context_
private

Definition at line 34 of file basic_waitable_timer.hpp.

boost::asio::basic_waitable_timer<std::chrono::system_clock> kagome::clock::BasicWaitableTimer::timer_
private

Definition at line 35 of file basic_waitable_timer.hpp.


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