summaryrefslogtreecommitdiff
path: root/source/api_wrappers/linux/CEventObject.h
blob: ec7d1267fe866c1dfa2f731379a76b15aefa5c99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*******************************************************************************
*
*  File name: CEventObjectObject.h
*  Language: Visual C++
*  Description: CEventObjectObject class declarations
*
*
* Copyright (C) ST-Ericsson SA 2011
* License terms: 3-clause BSD license
*
*******************************************************************************/

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//

#ifndef _CEVENTOBJECT_H
#define _CEVENTOBJECT_H

#include <semaphore.h>

#include "Types.h"
#include "CWaitableObject.h"

//class used to wrap the OS methods for even signaling
//implements Wait() method used when waiting for event to occur

class CEventObject : public CWaitableObject
{
public:
    CEventObject();
    virtual ~CEventObject();
    void SetEvent();
    void UnsetEvent();
    DWORD Wait(DWORD dwTimeout = INFINITE);
private:
#if defined(__APPLE__)
    sem_t *m_sem;
#elif defined(__linux__)
    sem_t m_sem;
#endif
};

#endif /* _CEVENTOBJECT_H */