mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-21 11:33:34 +08:00
Safer virtual methods; this breaks compatibility with GCC 4.6
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user