Safer virtual methods; this breaks compatibility with GCC 4.6

This commit is contained in:
Pavel Kirienko
2015-06-09 23:05:49 +03:00
parent 9ac2813cea
commit 7b44bf8822
6 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -67,7 +67,7 @@ static void runForever(const uavcan_linux::NodePtr& node)
{
explicit NodeStatusMonitor(uavcan::INode& node) : uavcan::NodeStatusMonitor(node) { }
virtual void handleNodeStatusChange(const NodeStatusChangeEvent& event)
void handleNodeStatusChange(const NodeStatusChangeEvent& event) override
{
std::cout << "Remote node NID " << int(event.node_id.get()) << " changed status: "
<< int(event.old_status.status_code) << " --> "
@@ -144,7 +144,7 @@ private:
bool had_events_ = false;
virtual void onEvent(uavcan::dynamic_node_id_server::TraceCode code, std::int64_t argument)
void onEvent(uavcan::dynamic_node_id_server::TraceCode code, std::int64_t argument) override
{
uavcan_posix::dynamic_node_id_server::FileEventTracer::onEvent(code, argument);
@@ -37,7 +37,7 @@ class Monitor : public uavcan::NodeStatusMonitor
uavcan_linux::TimerPtr timer_;
std::unordered_map<int, uavcan::protocol::NodeStatus> status_registry_;
virtual void handleNodeStatusMessage(const uavcan::ReceivedDataStructure<uavcan::protocol::NodeStatus>& msg)
void handleNodeStatusMessage(const uavcan::ReceivedDataStructure<uavcan::protocol::NodeStatus>& msg) override
{
status_registry_[msg.getSrcNodeID().get()] = msg;
}