-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdsr_signal_emitter.cpp
More file actions
94 lines (90 loc) · 3.37 KB
/
dsr_signal_emitter.cpp
File metadata and controls
94 lines (90 loc) · 3.37 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#include <dsr/api/dsr_api.h>
#include <dsr/api/dsr_signal_emitter.h>
#include <dsr/api/dsr_signal_info.h>
#include <dsr/api/dsr_logging.h>
void DSR::QueuedSignalRunner::run_update_node_signal(std::uint64_t a,
const std::string &b,
SignalInfo c) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] update_node id:", a, "type:", b);
tp.spawn_task([=, this] {
for (auto fn : uns_fns) {
if (fn)
fn(a, b);
}
});
}
void DSR::QueuedSignalRunner::run_update_node_attr_signal(
std::uint64_t a, const std::vector<std::string> &b, SignalInfo c) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] update_node_attr id:", a);
tp.spawn_task([=, this] {
for (auto fn : unas_fns) {
if (fn)
fn(a, b);
}
});
}
void DSR::QueuedSignalRunner::run_update_edge_signal(std::uint64_t a,
std::uint64_t b,
const std::string &c,
SignalInfo d) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] update_edge from:", a, "to:", b, "type:", c);
tp.spawn_task([=, this] {
for (auto fn : ues_fns) {
if (fn)
fn(a, b, c);
}
});
}
void DSR::QueuedSignalRunner::run_update_edge_attr_signal(
std::uint64_t a, std::uint64_t b, const std::string &c,
const std::vector<std::string> &d, SignalInfo e) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] update_edge_attr from:", a, "to:", b, "type:", c);
tp.spawn_task([=, this] {
for (auto fn : ueas_fns) {
if (fn)
fn(a, b, c, d);
}
});
}
void DSR::QueuedSignalRunner::run_del_edge_signal(std::uint64_t a,
std::uint64_t b,
const std::string &c,
SignalInfo d) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] del_edge from:", a, "to:", b, "type:", c);
tp.spawn_task([=, this] {
for (auto fn : des_fns) {
if (fn)
fn(a, b, c);
}
});
}
void DSR::QueuedSignalRunner::run_del_node_signal(std::uint64_t a,
SignalInfo b) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] del_node id:", a);
tp.spawn_task([=, this] {
for (auto fn : den_fns) {
if (fn)
fn(a);
}
});
}
void DSR::QueuedSignalRunner::run_deleted_node_signal(const Node &a,
SignalInfo b) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] deleted_node name:", a.name(), "id:", a.id());
tp.spawn_task([=, this] {
for (auto fn : dn_fns) {
if (fn)
fn(a);
}
});
}
void DSR::QueuedSignalRunner::run_deleted_edge_signal(const Edge &a,
SignalInfo b) {
DSR_LOG_DEBUG_L(static_cast<DSR::GraphSettings::LOGLEVEL>(log_level), "[SIGNAL] deleted_edge from:", a.from(), "to:", a.to(), "type:", a.type());
tp.spawn_task([=, this] {
for (auto fn : de_fns) {
if (fn)
fn(a);
}
});
}