Thrill  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ProfileThread Class Reference

Detailed Description

Definition at line 32 of file profile_thread.hpp.

+ Collaboration diagram for ProfileThread:

#include <profile_thread.hpp>

Classes

struct  Timer
 struct for timer callbacks More...
 

Public Types

using milliseconds = std::chrono::milliseconds
 
using steady_clock = std::chrono::steady_clock
 

Public Member Functions

 ProfileThread ()
 
 ProfileThread (const ProfileThread &)=delete
 non-copyable: delete copy-constructor More...
 
 ~ProfileThread ()
 
template<typename Period >
void Add (const Period &period, ProfileTask *task, bool own_task=false)
 Register a regularly scheduled callback. More...
 
ProfileThreadoperator= (const ProfileThread &)=delete
 non-copyable: delete assignment operator More...
 
bool Remove (ProfileTask *task)
 Unregister a regularly scheduled callback. More...
 

Private Types

using TimerPQ = BinaryHeap< Timer >
 priority queue of interval scheduled callbacks More...
 

Private Member Functions

void Worker ()
 the thread worker function More...
 

Private Attributes

std::condition_variable_any cv_
 cv/mutex pair to signal thread to terminate More...
 
std::timed_mutex mutex_
 cv/mutex pair to signal thread to terminate More...
 
TimerPQ tasks_
 priority queue of interval scheduled callbacks More...
 
std::atomic< bool > terminate_ { false }
 flag to terminate profiling thread More...
 
std::thread thread_
 thread for profiling (only run on top-level loggers) More...
 

Member Typedef Documentation

using milliseconds = std::chrono::milliseconds

Definition at line 35 of file profile_thread.hpp.

using steady_clock = std::chrono::steady_clock

Definition at line 36 of file profile_thread.hpp.

using TimerPQ = BinaryHeap<Timer>
private

priority queue of interval scheduled callbacks

Definition at line 92 of file profile_thread.hpp.

Constructor & Destructor Documentation

ProfileThread ( const ProfileThread )
delete

non-copyable: delete copy-constructor

Member Function Documentation

void Add ( const Period &  period,
ProfileTask task,
bool  own_task = false 
)
inline
ProfileThread& operator= ( const ProfileThread )
delete

non-copyable: delete assignment operator

bool Remove ( ProfileTask task)

Member Data Documentation

std::condition_variable_any cv_
private

cv/mutex pair to signal thread to terminate

Definition at line 71 of file profile_thread.hpp.

Referenced by ProfileThread::Add(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().

std::timed_mutex mutex_
private

cv/mutex pair to signal thread to terminate

Definition at line 68 of file profile_thread.hpp.

Referenced by ProfileThread::Add(), ProfileThread::Remove(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().

TimerPQ tasks_
private

priority queue of interval scheduled callbacks

Definition at line 95 of file profile_thread.hpp.

Referenced by ProfileThread::Add(), ProfileThread::Remove(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().

std::atomic<bool> terminate_ { false }
private

flag to terminate profiling thread

Definition at line 65 of file profile_thread.hpp.

Referenced by ProfileThread::Worker(), and ProfileThread::~ProfileThread().

std::thread thread_
private

thread for profiling (only run on top-level loggers)

Definition at line 62 of file profile_thread.hpp.

Referenced by ProfileThread::ProfileThread(), and ProfileThread::~ProfileThread().


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