xbmc
Public Member Functions | Friends | List of all members
CEvent Class Reference

This is an Event class built from a ConditionVariable. More...

#include <Event.h>

Inheritance diagram for CEvent:
Inheritance graph
[legend]

Public Member Functions

 CEvent (bool manual=false, bool signaled_=false)
 
void Reset ()
 
void Set ()
 
bool Signaled ()
 Returns true if Event has been triggered and not reset, false otherwise.
 
template<typename Rep , typename Period >
bool Wait (std::chrono::duration< Rep, Period > duration)
 This will wait up to 'duration' for the Event to be triggered. More...
 
bool Wait ()
 This will wait for the Event to be triggered. More...
 
int getNumWaits ()
 This is mostly for testing. More...
 

Friends

class XbmcThreads::CEventGroup
 

Detailed Description

This is an Event class built from a ConditionVariable.

The Event adds the state that the condition is gating as well as the mutex/lock.

This Event can be 'interruptible' (even though there is only a single place in the code that uses this behavior).

This class manages 'spurious returns' from the condition variable.

Member Function Documentation

◆ getNumWaits()

int CEvent::getNumWaits ( )
inline

This is mostly for testing.

It allows a thread to make sure there are the right amount of other threads waiting.

◆ Wait() [1/2]

template<typename Rep , typename Period >
bool CEvent::Wait ( std::chrono::duration< Rep, Period >  duration)
inline

This will wait up to 'duration' for the Event to be triggered.

The method will return 'true' if the Event was triggered. Otherwise it will return false.

◆ Wait() [2/2]

bool CEvent::Wait ( )
inline

This will wait for the Event to be triggered.

The method will return 'true' if the Event was triggered. If it was either interrupted it will return false. Otherwise it will return false.


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