idle_detect  0.8.3.0
Provides overall idle detection for a linux computer
Classes | Public Member Functions | Public Attributes | Private Attributes | List of all members
EventDetect::InputEventRecorders Class Reference

The InputEventRecorders class provides the framework for recording event activity from each of the input event devices that are classified as a pointing device (mouse). It is a singleton, but has multiple subordinate threads running, 1 thread for each identified device to monitor. More...

#include <event_detect.h>

Classes

class  EventRecorder
 The EventRecorder class formalizes the event recorder instance and is instantiated for each event recorder thread. These instantiations are wrapped by shared_ptr objects and the shared_ptrs stored in the m_event_recorder_ptrs vector. This is essentially a very specialized thread pool. More...
 

Public Member Functions

 InputEventRecorders ()
 Constructor.
 
int64_t GetTotalEventCount () const
 Provides the total count (tally) of events across all monitored devices. More...
 
std::vector< std::shared_ptr< EventRecorder > > & GetEventRecorders ()
 Returns a reference to the event recorder objects thread pool. More...
 
void ResetEventRecorders ()
 

Public Attributes

std::condition_variable cv_recorder_threads
 Condition variable for control/synchronization of the recorder threads.
 
std::atomic< bool > m_interrupt_recorders
 Atomic boolean that interrupts the recorder threads.
 

Private Attributes

std::mutex mtx_event_recorders
 This is the mutex member that provides lock control for the input event recorders object. This is used to ensure the input event recorders is thread-safe. Note that the subordinate individual event recorders are covered by their own individual locks.
 
std::mutex mtx_event_recorder_threads
 This provides lock control for the recorder worker threads themselves.
 
std::vector< std::shared_ptr< EventRecorder > > m_event_recorder_ptrs
 Holds smart shared pointers to the event recorder threads. This is a specialized thread pool with associated metadata.
 

Detailed Description

The InputEventRecorders class provides the framework for recording event activity from each of the input event devices that are classified as a pointing device (mouse). It is a singleton, but has multiple subordinate threads running, 1 thread for each identified device to monitor.

Member Function Documentation

◆ GetEventRecorders()

std::vector< std::shared_ptr< InputEventRecorders::EventRecorder > > & InputEventRecorders::GetEventRecorders ( )

Returns a reference to the event recorder objects thread pool.

Returns
vector of smart shared pointers to the event recorders

◆ GetTotalEventCount()

int64_t InputEventRecorders::GetTotalEventCount ( ) const

Provides the total count (tally) of events across all monitored devices.

Returns total event count across all recorders.

Returns
int64_t of total event count
Here is the caller graph for this function:

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