-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAfterTime.h
More file actions
46 lines (38 loc) · 963 Bytes
/
AfterTime.h
File metadata and controls
46 lines (38 loc) · 963 Bytes
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
/*******************************************************************************
* Copyright (c) 2018 Rediscover.
*
*******************************************************************************/
#ifndef AFTERTIME_H
#define AFTERTIME_H
#include "mbed.h"
#include "rtos.h"
#include "Msg.h"
#include "Actor.h"
/*!
AfterTime can be used by an actor to have a messag sent after
a specified period of time. The type of the message to be sent is
given with the call to sendAfter().
*/
class AfterTime
{
public:
AfterTime();
~AfterTime();
void sendAfter(Actor *act, int time, MsgType type);
void timeHandler(MsgType c);
void doDispatch();
private:
/*!
The EventQueue which will call timeHandler() at a later moment.
*/
EventQueue queue;
/*!
This threat must call the dispatch() at the queue regularly.
*/
Thread th;
/*!
The client of this class
*/
Actor *actor;
};
#endif