|
@@ -57,11 +57,11 @@ public:
|
|
|
|
|
|
virtual ~Coordinator() {}
|
|
virtual ~Coordinator() {}
|
|
|
|
|
|
- GraphManager &get_graph_manager() { return _graph_manager; }
|
|
|
|
|
|
+ GraphManager &get_graph_manager() override { return _graph_manager; }
|
|
|
|
|
|
- const GraphManager &get_graph_manager() const { return _graph_manager; }
|
|
|
|
|
|
+ const GraphManager &get_graph_manager() const override { return _graph_manager; }
|
|
|
|
|
|
- virtual std::string to_string(int level) const {
|
|
|
|
|
|
+ std::string to_string(int level) const override {
|
|
std::ostringstream ss;
|
|
std::ostringstream ss;
|
|
|
|
|
|
ss << common::String::make_spaces(level * 2) << "p-devs coordinator \""
|
|
ss << common::String::make_spaces(level * 2) << "p-devs coordinator \""
|
|
@@ -70,14 +70,14 @@ public:
|
|
return ss.str();
|
|
return ss.str();
|
|
}
|
|
}
|
|
|
|
|
|
- void restore(const common::context::State <Time> &state) {
|
|
|
|
|
|
+ void restore(const common::context::State<Time> &state) override {
|
|
common::Coordinator<Time>::restore(state);
|
|
common::Coordinator<Time>::restore(state);
|
|
for (auto &child: _graph_manager.children()) {
|
|
for (auto &child: _graph_manager.children()) {
|
|
_event_table.init(child->get_tn(), child);
|
|
_event_table.init(child->get_tn(), child);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- virtual void finish(const typename Time::type &t) {
|
|
|
|
|
|
+ virtual void finish(const typename Time::type &t) override {
|
|
#ifndef WITH_TRACE
|
|
#ifndef WITH_TRACE
|
|
(void) t;
|
|
(void) t;
|
|
#endif
|
|
#endif
|
|
@@ -92,7 +92,7 @@ public:
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
- typename Time::type start(const typename Time::type &t) {
|
|
|
|
|
|
+ typename Time::type start(const typename Time::type &t) override {
|
|
// When i-message (i, t) at time t
|
|
// When i-message (i, t) at time t
|
|
// for-each d ∈ D do
|
|
// for-each d ∈ D do
|
|
// send i-message to child d
|
|
// send i-message to child d
|
|
@@ -134,7 +134,7 @@ public:
|
|
return type::_tn;
|
|
return type::_tn;
|
|
}
|
|
}
|
|
|
|
|
|
- void output(const typename Time::type &t) {
|
|
|
|
|
|
+ void output(const typename Time::type &t) override {
|
|
// When *-message (*, t)
|
|
// When *-message (*, t)
|
|
// if t != tn then Error
|
|
// if t != tn then Error
|
|
// IMM = {d | (d, th,d) ∈ (event-list & tn,d = tn) }
|
|
// IMM = {d | (d, th,d) ∈ (event-list & tn,d = tn) }
|
|
@@ -155,7 +155,7 @@ public:
|
|
|
|
|
|
assert(t == type::_tn);
|
|
assert(t == type::_tn);
|
|
|
|
|
|
- common::Models <Time> IMM = _event_table.get_current_models(t);
|
|
|
|
|
|
+ common::Models<Time> IMM = _event_table.get_current_models(t);
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
#ifdef WITH_TRACE
|
|
common::Trace<Time>::trace()
|
|
common::Trace<Time>::trace()
|
|
@@ -184,7 +184,7 @@ public:
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- typename Time::type transition(const typename Time::type &t) {
|
|
|
|
|
|
+ typename Time::type transition(const typename Time::type &t) override {
|
|
// When x-message (x, t)
|
|
// When x-message (x, t)
|
|
// if not (tl <= t <= tn) then Error
|
|
// if not (tl <= t <= tn) then Error
|
|
// receivers = { r | r ∈ children, N ∈ Ir, Z(N,r)(x) isn't empty }
|
|
// receivers = { r | r ∈ children, N ∈ Ir, Z(N,r)(x) isn't empty }
|
|
@@ -210,8 +210,8 @@ public:
|
|
|
|
|
|
assert(t >= type::_tl and t <= type::_tn);
|
|
assert(t >= type::_tl and t <= type::_tn);
|
|
|
|
|
|
- common::Models <Time> receivers = get_receivers();
|
|
|
|
- common::Models <Time> IMM = _event_table.get_current_models(t);
|
|
|
|
|
|
+ common::Models<Time> receivers = get_receivers();
|
|
|
|
+ common::Models<Time> IMM = _event_table.get_current_models(t);
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
#ifdef WITH_TRACE
|
|
common::Trace<Time>::trace()
|
|
common::Trace<Time>::trace()
|
|
@@ -251,7 +251,7 @@ public:
|
|
return type::_tn;
|
|
return type::_tn;
|
|
}
|
|
}
|
|
|
|
|
|
- void post_event(const typename Time::type &t, const common::event::ExternalEvent <Time> &event) {
|
|
|
|
|
|
+ void post_event(const typename Time::type &t, const common::event::ExternalEvent<Time> &event) override {
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
#ifdef WITH_TRACE
|
|
common::Trace<Time>::trace()
|
|
common::Trace<Time>::trace()
|
|
@@ -280,8 +280,7 @@ public:
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- typename Time::type dispatch_events(const common::event::Bag <Time> &bag,
|
|
|
|
- const typename Time::type &t) {
|
|
|
|
|
|
+ typename Time::type dispatch_events(const common::event::Bag<Time> &bag, const typename Time::type &t) override {
|
|
|
|
|
|
#ifdef WITH_TRACE
|
|
#ifdef WITH_TRACE
|
|
common::Trace<Time>::trace()
|
|
common::Trace<Time>::trace()
|
|
@@ -313,18 +312,17 @@ public:
|
|
return type::_tn;
|
|
return type::_tn;
|
|
}
|
|
}
|
|
|
|
|
|
- common::event::Value observe(const typename Time::type & /* t */,
|
|
|
|
- unsigned int /* index */) const {
|
|
|
|
|
|
+ common::event::Value observe(const typename Time::type & /* t */, unsigned int /* index */) const override {
|
|
assert(false);
|
|
assert(false);
|
|
return common::event::Value();
|
|
return common::event::Value();
|
|
}
|
|
}
|
|
|
|
|
|
- typename Time::type lookahead(const typename Time::type &t) const {
|
|
|
|
|
|
+ typename Time::type lookahead(const typename Time::type &t) const override {
|
|
return _graph_manager.lookahead(t);
|
|
return _graph_manager.lookahead(t);
|
|
}
|
|
}
|
|
|
|
|
|
- common::Models <Time> get_receivers() const {
|
|
|
|
- common::Models <Time> receivers;
|
|
|
|
|
|
+ common::Models<Time> get_receivers() const {
|
|
|
|
+ common::Models<Time> receivers;
|
|
|
|
|
|
for (auto &model: _graph_manager.children()) {
|
|
for (auto &model: _graph_manager.children()) {
|
|
if (model->event_number() > 0) {
|
|
if (model->event_number() > 0) {
|