Nebula
Loading...
Searching...
No Matches
Linux::LinuxEvent Class Reference

#include <linuxevent.h>

Detailed Description

Linux implementation of Event.

Uses pthread condition variables.

(C) 2010 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file

Public Member Functions

 LinuxEvent (bool manualReset=false)
 constructor
 
 LinuxEvent (LinuxEvent &&ev)
 Move constructor.
 
 ~LinuxEvent ()
 destructor
 
void Signal ()
 signal the event
 
void Wait () const
 wait for the event to become signalled, resets the event
 
bool WaitTimeout (int ms) const
 wait for the event with timeout in millisecs, resets the event
 
bool Peek () const
 check if event is signaled
 
void Reset ()
 manually reset the event
 
bool IsManual () const
 Returns true if event is manually reset.
 

Private Types

enum  EventStatus { SIGNAL_NONE = 0 , SIGNAL_ONE = 1 , SIGNAL_ALL = 2 }
 

Private Attributes

pthread_mutex_t mutex
 
pthread_cond_t cond
 
bool manualReset
 
volatile EventStatus status
 

Member Enumeration Documentation

◆ EventStatus

Enumerator
SIGNAL_NONE 
SIGNAL_ONE 
SIGNAL_ALL 

Constructor & Destructor Documentation

◆ LinuxEvent() [1/2]

Linux::LinuxEvent::LinuxEvent ( bool manualReset = false)
inline

constructor

◆ LinuxEvent() [2/2]

Linux::LinuxEvent::LinuxEvent ( LinuxEvent && ev)
inline

Move constructor.

◆ ~LinuxEvent()

Linux::LinuxEvent::~LinuxEvent ( )
inline

destructor

Member Function Documentation

◆ IsManual()

bool Linux::LinuxEvent::IsManual ( ) const
inline

Returns true if event is manually reset.

◆ Peek()

bool Linux::LinuxEvent::Peek ( ) const
inline

check if event is signaled

◆ Reset()

void Linux::LinuxEvent::Reset ( )
inline

manually reset the event

◆ Signal()

void Linux::LinuxEvent::Signal ( )
inline

signal the event

◆ Wait()

void Linux::LinuxEvent::Wait ( ) const
inline

wait for the event to become signalled, resets the event

◆ WaitTimeout()

bool Linux::LinuxEvent::WaitTimeout ( int ms) const
inline

wait for the event with timeout in millisecs, resets the event

Member Data Documentation

◆ cond

pthread_cond_t Linux::LinuxEvent::cond
mutableprivate

◆ manualReset

bool Linux::LinuxEvent::manualReset
private

◆ mutex

pthread_mutex_t Linux::LinuxEvent::mutex
mutableprivate

◆ status

volatile EventStatus Linux::LinuxEvent::status
mutableprivate

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