Dash Core  0.12.2.1
P2P Digital Currency
CScheduler Class Reference

#include <scheduler.h>

Public Types

typedef boost::function< void(void)> Function
 

Public Member Functions

 CScheduler ()
 
 ~CScheduler ()
 
void schedule (Function f, boost::chrono::system_clock::time_point t)
 
void scheduleFromNow (Function f, int64_t deltaSeconds)
 
void scheduleEvery (Function f, int64_t deltaSeconds)
 
void serviceQueue ()
 
void stop (bool drain=false)
 
size_t getQueueInfo (boost::chrono::system_clock::time_point &first, boost::chrono::system_clock::time_point &last) const
 

Private Member Functions

bool shouldStop ()
 

Private Attributes

std::multimap< boost::chrono::system_clock::time_point, FunctiontaskQueue
 
boost::condition_variable newTaskScheduled
 
boost::mutex newTaskMutex
 
int nThreadsServicingQueue
 
bool stopRequested
 
bool stopWhenEmpty
 

Detailed Description

Definition at line 36 of file scheduler.h.

Member Typedef Documentation

◆ Function

typedef boost::function<void(void)> CScheduler::Function

Definition at line 42 of file scheduler.h.

Constructor & Destructor Documentation

◆ CScheduler()

CScheduler::CScheduler ( )

Definition at line 13 of file scheduler.cpp.

◆ ~CScheduler()

CScheduler::~CScheduler ( )

Definition at line 17 of file scheduler.cpp.

Member Function Documentation

◆ getQueueInfo()

size_t CScheduler::getQueueInfo ( boost::chrono::system_clock::time_point &  first,
boost::chrono::system_clock::time_point &  last 
) const

Definition at line 122 of file scheduler.cpp.

◆ schedule()

void CScheduler::schedule ( CScheduler::Function  f,
boost::chrono::system_clock::time_point  t 
)

Definition at line 97 of file scheduler.cpp.

Referenced by scheduleFromNow().

◆ scheduleEvery()

void CScheduler::scheduleEvery ( CScheduler::Function  f,
int64_t  deltaSeconds 
)

Definition at line 117 of file scheduler.cpp.

Referenced by CConnman::Start().

◆ scheduleFromNow()

void CScheduler::scheduleFromNow ( CScheduler::Function  f,
int64_t  deltaSeconds 
)

Definition at line 106 of file scheduler.cpp.

Referenced by Repeat(), and scheduleEvery().

◆ serviceQueue()

void CScheduler::serviceQueue ( )

Definition at line 30 of file scheduler.cpp.

Referenced by AppInit2().

◆ shouldStop()

bool CScheduler::shouldStop ( )
inlineprivate

Definition at line 80 of file scheduler.h.

Referenced by serviceQueue().

◆ stop()

void CScheduler::stop ( bool  drain = false)

Definition at line 85 of file scheduler.cpp.

Member Data Documentation

◆ newTaskMutex

boost::mutex CScheduler::newTaskMutex
mutableprivate

Definition at line 76 of file scheduler.h.

Referenced by getQueueInfo(), schedule(), serviceQueue(), and stop().

◆ newTaskScheduled

boost::condition_variable CScheduler::newTaskScheduled
private

Definition at line 75 of file scheduler.h.

Referenced by schedule(), serviceQueue(), and stop().

◆ nThreadsServicingQueue

int CScheduler::nThreadsServicingQueue
private

Definition at line 77 of file scheduler.h.

Referenced by serviceQueue(), and ~CScheduler().

◆ stopRequested

bool CScheduler::stopRequested
private

Definition at line 78 of file scheduler.h.

Referenced by shouldStop(), and stop().

◆ stopWhenEmpty

bool CScheduler::stopWhenEmpty
private

Definition at line 79 of file scheduler.h.

Referenced by shouldStop(), and stop().

◆ taskQueue

std::multimap<boost::chrono::system_clock::time_point, Function> CScheduler::taskQueue
private

Definition at line 74 of file scheduler.h.

Referenced by getQueueInfo(), schedule(), serviceQueue(), and shouldStop().


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