-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCallbacks.h
More file actions
39 lines (32 loc) · 1.02 KB
/
Callbacks.h
File metadata and controls
39 lines (32 loc) · 1.02 KB
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
#pragma once
#include "Ref.h"
#include "Function.h"
#include "Callbacks.h"
#include "Configuration.h"
namespace MonitoringComponents {
class DiscreteInputChannel;
class AnalogInputChannel;
struct ChannelMessage {
ChannelAction channelAction;
int actionId;
ActionType type;
ChannelAddress channel;
ChannelMessage(ChannelAction cAction,int id,ActionType aType,ChannelAddress ch)
:channelAction(cAction),actionId(id),type(aType),channel(ch) { }
ChannelMessage() {
this->channelAction = ChannelAction::Clear;
this->actionId = -1;
this->type = ActionType::Okay;
}
ChannelMessage& operator=(const ChannelMessage& msg) {
this->channelAction = msg.channelAction;
this->actionId = msg.actionId;
this->type = msg.type;
this->channel = msg.channel;
}
};
typedef Function<void(void)> VoidCallback;
typedef Function<void(Ref<DiscreteInputChannel>)> DiscreteInputCallback;
typedef Function<void(Ref<AnalogInputChannel>)> AnalogInputCallback;
typedef Function<void(ChannelMessage)> ChannelCallback;
};