SWC-DB  v0.5.12 C++ documentations
SWC-DB© (Super Wide Column Database) - High Performance Scalable Database (https://github.com/kashirin-alex/swc-db)
SWC::Comm::PeriodicTimer Class Referencefinal

#include <swcdb/core/comm/PeriodicTimer.h>

+ Collaboration diagram for SWC::Comm::PeriodicTimer:

Public Types

typedef const std::function< void()> Call_t

Public Member Functions

 PeriodicTimer (const Config::Property::Value_int32_g::Ptr cfg_ms, Call_t &&call, const IoContextPtr &ioctx)
 PeriodicTimer (PeriodicTimer &&)=delete
 PeriodicTimer (const PeriodicTimer &)=delete
PeriodicTimeroperator= (PeriodicTimer &&)=delete
PeriodicTimeroperator= (const PeriodicTimer &)=delete
 ~PeriodicTimer () noexcept
void cancel ()

Private Member Functions

void schedule ()

Private Attributes

const Config::Property::Value_int32_g::Ptr m_ms
const Call_t m_call
Core::MutexAtomic m_mutex
asio::high_resolution_timer m_timer

Detailed Description

Definition at line 16 of file PeriodicTimer.h.

Member Typedef Documentation

◆ Call_t

typedef const std::function<void()> SWC::Comm::PeriodicTimer::Call_t

Definition at line 18 of file PeriodicTimer.h.

Constructor & Destructor Documentation

◆ PeriodicTimer() [1/3]

SWC::Comm::PeriodicTimer::PeriodicTimer ( const Config::Property::Value_int32_g::Ptr  cfg_ms,
PeriodicTimer::Call_t &&  call,
const IoContextPtr ioctx 

Definition at line 10 of file PeriodicTimer.cc.

References schedule().

+ Here is the call graph for this function:

◆ PeriodicTimer() [2/3]

SWC::Comm::PeriodicTimer::PeriodicTimer ( PeriodicTimer &&  )

◆ PeriodicTimer() [3/3]

SWC::Comm::PeriodicTimer::PeriodicTimer ( const PeriodicTimer )

◆ ~PeriodicTimer()

SWC::Comm::PeriodicTimer::~PeriodicTimer ( )

Definition at line 19 of file PeriodicTimer.cc.

References m_timer.

Member Function Documentation

◆ cancel()

void SWC::Comm::PeriodicTimer::cancel ( )

Definition at line 40 of file PeriodicTimer.cc.

References m_mutex, and m_timer.

◆ operator=() [1/2]

PeriodicTimer& SWC::Comm::PeriodicTimer::operator= ( const PeriodicTimer )

◆ operator=() [2/2]

PeriodicTimer& SWC::Comm::PeriodicTimer::operator= ( PeriodicTimer &&  )

◆ schedule()

void SWC::Comm::PeriodicTimer::schedule ( )

Definition at line 23 of file PeriodicTimer.cc.

References SWC::Config::Property::Value_int32_g::get(), m_call, m_ms, m_mutex, m_timer, schedule(), and SWC_CAN_INLINE.

Referenced by PeriodicTimer(), and schedule().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ m_call

const Call_t SWC::Comm::PeriodicTimer::m_call

Definition at line 37 of file PeriodicTimer.h.

Referenced by schedule().

◆ m_ms

const Config::Property::Value_int32_g::Ptr SWC::Comm::PeriodicTimer::m_ms

Definition at line 36 of file PeriodicTimer.h.

Referenced by schedule().

◆ m_mutex

Core::MutexAtomic SWC::Comm::PeriodicTimer::m_mutex

Definition at line 38 of file PeriodicTimer.h.

Referenced by cancel(), and schedule().

◆ m_timer

asio::high_resolution_timer SWC::Comm::PeriodicTimer::m_timer

Definition at line 39 of file PeriodicTimer.h.

Referenced by cancel(), schedule(), and ~PeriodicTimer().

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