blob: f73f4b1fc244fcc9b4e33a32f237d6681871c07d (
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
45
46
47
48
49
50
51
52
|
#ifndef __ASRUA_EDTIRO_SIGNAL_H__
#define __ASRUA_EDTIRO_SIGNAL_H__
#include <vector>
#include <asura-utils/scripting/portable.hpp>
#include "../widgets/widget.h"
#include "slot.h"
namespace AsuraEditor
{
///
/// ؼ¼
///
class Signal
{
public:
Signal();
///
/// Fire¼connectļߣãconnectĺ
///
void operator()(void* userdata)
{
for (auto callback : mCallbacks)
callback();
}
///
/// עص
///
void Connect(const Slot& callback)
{
mCallbacks.push_back(callback);
}
///
///
///
void Disconnect();
private:
std::vector<Slot> mCallbacks; //
};
}
#endif
|