-
Notifications
You must be signed in to change notification settings - Fork 1
/
vex_event.h
52 lines (42 loc) · 2.21 KB
/
vex_event.h
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
45
46
47
48
49
50
51
52
/*----------------------------------------------------------------------------*/
/* */
/* Copyright (c) Innovation First 2017, All rights reserved. */
/* */
/* Module: vex_event.h */
/* Author: James Pearman */
/* Created: 7 July 2017 */
/* */
/* Revisions: */
/* V1.00 TBD - Initial release */
/* */
/*----------------------------------------------------------------------------*/
#ifndef VCS_EVENT_CLASS_H
#define VCS_EVENT_CLASS_H
/*-----------------------------------------------------------------------------*/
/** @file vex_event.h
* @brief event handler class header
*//*---------------------------------------------------------------------------*/
namespace vex {
class event {
private:
static uint32_t _usereventid;
void (* _callback)(void);
int _userid;
public:
event();
event( uint32_t index, uint32_t mask, void (* callback)(void) );
event( void (* callback)(void) );
event( event v, void (* callback)(void) );
~event();
static void init( uint32_t index, uint32_t mask, void (* callback)(void) );
// Do not use for now - here for testing
static void init( uint32_t index, uint32_t mask, void (* callback)(int) );
static void init( uint32_t index, uint32_t mask, void (* callback)(void *), void *arg );
static int32_t userindex(void);
void broadcast();
void broadcastAndWait( int32_t timeout = 60000 );
static void broadcast( uint32_t index );
static void broadcastAndWait( uint32_t index, int32_t timeout = 60000 );
};
};
#endif // VCS_EVENT_CLASS_H