mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 01:03:33 +08:00
Better naming
This commit is contained in:
@@ -34,7 +34,7 @@ public:
|
||||
/**
|
||||
* This method will be invoked when a new log entry is committed (only if the local server is the current Leader).
|
||||
*/
|
||||
virtual void onEntryCommitted(const Entry& entry) = 0;
|
||||
virtual void onEntryCommit(const Entry& entry) = 0;
|
||||
|
||||
/**
|
||||
* Assume false by default.
|
||||
@@ -373,7 +373,7 @@ class RaftCore : private TimerBase
|
||||
trace(TraceRaftNewEntryCommitted, commit_index_);
|
||||
|
||||
// AT THIS POINT ALLOCATION IS COMPLETE
|
||||
log_commit_handler_.onEntryCommitted(*persistent_state_.getLog().getEntryAtIndex(commit_index_));
|
||||
log_commit_handler_.onEntryCommit(*persistent_state_.getLog().getEntryAtIndex(commit_index_));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ class Server : private IAllocationRequestHandler
|
||||
}
|
||||
}
|
||||
|
||||
virtual void onEntryCommitted(const protocol::dynamic_node_id::server::Entry& entry)
|
||||
virtual void onEntryCommit(const protocol::dynamic_node_id::server::Entry& entry)
|
||||
{
|
||||
tryPublishAllocationResult(entry);
|
||||
}
|
||||
|
||||
@@ -22,14 +22,14 @@ class CommitHandler : public uavcan::dynamic_node_id_server::distributed::ILeade
|
||||
{
|
||||
const std::string id_;
|
||||
|
||||
virtual void onEntryCommitted(const uavcan::protocol::dynamic_node_id::server::Entry& entry)
|
||||
virtual void onEntryCommit(const uavcan::protocol::dynamic_node_id::server::Entry& entry)
|
||||
{
|
||||
std::cout << "ENTRY COMMITTED [" << id_ << "]\n" << entry << std::endl;
|
||||
}
|
||||
|
||||
virtual void onLeaderChange(bool local_node_is_leader)
|
||||
{
|
||||
std::cout << "I AM LEADER: " << (local_node_is_leader ? "YES" : "NOT ANYMORE") << std::endl;
|
||||
std::cout << "I AM LEADER [" << id_ << "]: " << (local_node_is_leader ? "YES" : "NOT ANYMORE") << std::endl;
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Reference in New Issue
Block a user