VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex_event.h
Go to the documentation of this file.
1/*----------------------------------------------------------------------------*/
2/* */
3/* Copyright (c) Innovation First 2017, All rights reserved. */
4/* */
5/* Module: vex_event.h */
6/* Author: James Pearman */
7/* Created: 7 July 2017 */
8/* */
9/* Revisions: */
10/* V1.00 TBD - Initial release */
11/* */
12/*----------------------------------------------------------------------------*/
13
14#ifndef VEX_EVENT_CLASS_H
15#define VEX_EVENT_CLASS_H
16
17/*-----------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace vex {
23 class event {
24 private:
25 static int16_t _usereventid;
26 void (* _callback)(void);
27 int _userid;
28
29 public:
30 event();
31 event( int16_t index, uint32_t mask, void (* callback)(void) );
32 event( void (* callback)(void) );
33 event( event v, void (* callback)(void) );
34 event( void (* callback)(void *), void *arg );
35 event( event v, void (* callback)(void *), void *arg );
36 ~event();
37
38 static void init( int16_t index, uint32_t mask, void (* callback)(void) );
39 // Do not use for now - here for testing
40 static void init( int16_t index, uint32_t mask, void (* callback)(int) );
41 static void init( int16_t index, uint32_t mask, void (* callback)(void *), void *arg );
42 static int32_t userindex(void);
43
44 void set( void (* callback)(void) );
45 void operator()( void (* callback)(void) );
46
47 void broadcast();
48
49
50 void broadcastAndWait( int32_t timeout = 60000 );
51 static void broadcast( int16_t index );
52 static void broadcastAndWait( int16_t index, int32_t timeout = 60000 );
53 };
54};
55
56#endif // VEX_EVENT_CLASS_H
Bumper switch device class
Definition vex_brain.h:24