|
idle_detect
0.8.3.0
Provides overall idle detection for a linux computer
|
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...
#include <event_detect.h>
Public Member Functions | |
| EventRecorder (fs::path event_device_path) | |
| Parameterized constructor. More... | |
| fs::path | GetEventDevicePath () const |
| Gets the event device path. More... | |
| int64_t | GetEventCount () const |
| Returns the current event count tallied by the recorder. More... | |
| void | EventActivityRecorderThread () |
| Method to run in the instantiated recorder thread. | |
Public Attributes | |
| std::thread | m_event_recorder_thread |
| Holds the actual event recorder thread. | |
Private Attributes | |
| std::mutex | mtx_event_recorder |
| This is the mutex member that provides lock control for the individual event recorder. | |
| fs::path | m_event_device_path |
| Holds the event device path of the monitored device. | |
| std::atomic< int64_t > | m_event_count |
| Atomic that holds the current event tally for the monitored device. | |
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.
|
explicit |
Parameterized constructor.
| Required | parameter for construction: event_device_path |
| int64_t InputEventRecorders::EventRecorder::GetEventCount | ( | ) | const |
Returns the current event count tallied by the recorder.
| fs::path InputEventRecorders::EventRecorder::GetEventDevicePath | ( | ) | const |
Gets the event device path.
Returns a read only fs::path of the input event device path associated with the recorder. No locking is needed as this can only be changed on construction.
1.8.14