PIVX Core  5.6.99
P2P Digital Currency
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CScheduler Class Reference

#include <scheduler.h>

Collaboration diagram for CScheduler:
[legend]

Public Types

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

Public Member Functions

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

Private Member Functions

std::multimap< std::chrono::system_clock::time_point, Function > taskQueue GUARDED_BY (newTaskMutex)
 
int nThreadsServicingQueue GUARDED_BY (newTaskMutex)
 
bool stopRequested GUARDED_BY (newTaskMutex)
 
bool stopWhenEmpty GUARDED_BY (newTaskMutex)
 
bool shouldStop () const EXCLUSIVE_LOCKS_REQUIRED(newTaskMutex)
 

Private Attributes

Mutex newTaskMutex
 
std::condition_variable newTaskScheduled
 

Detailed Description

Definition at line 39 of file scheduler.h.

Member Typedef Documentation

◆ Function

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

Definition at line 45 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

◆ AreThreadsServicingQueue()

bool CScheduler::AreThreadsServicingQueue ( ) const

Definition at line 122 of file scheduler.cpp.

Here is the caller graph for this function:

◆ getQueueInfo()

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

Definition at line 110 of file scheduler.cpp.

Here is the caller graph for this function:

◆ GUARDED_BY() [1/4]

std::multimap<std::chrono::system_clock::time_point, Function> taskQueue CScheduler::GUARDED_BY ( newTaskMutex  )
private

◆ GUARDED_BY() [2/4]

int nThreadsServicingQueue CScheduler::GUARDED_BY ( newTaskMutex  )
private

◆ GUARDED_BY() [3/4]

bool stopRequested CScheduler::GUARDED_BY ( newTaskMutex  )
private

◆ GUARDED_BY() [4/4]

bool stopWhenEmpty CScheduler::GUARDED_BY ( newTaskMutex  )
private

◆ schedule()

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

Definition at line 85 of file scheduler.cpp.

Here is the caller graph for this function:

◆ scheduleEvery()

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

Definition at line 105 of file scheduler.cpp.

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

◆ scheduleFromNow()

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

Definition at line 94 of file scheduler.cpp.

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

◆ serviceQueue()

void CScheduler::serviceQueue ( )

Definition at line 22 of file scheduler.cpp.

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

◆ shouldStop()

bool CScheduler::shouldStop ( ) const
inlineprivate

Definition at line 86 of file scheduler.h.

Here is the caller graph for this function:

◆ stop()

void CScheduler::stop ( bool  drain = false)

Definition at line 73 of file scheduler.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ newTaskMutex

Mutex CScheduler::newTaskMutex
mutableprivate

Definition at line 80 of file scheduler.h.

◆ newTaskScheduled

std::condition_variable CScheduler::newTaskScheduled
private

Definition at line 81 of file scheduler.h.


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