mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 06:23:34 +08:00
Persistent storage implementation
This commit is contained in:
@@ -192,6 +192,9 @@ class PersistentState
|
||||
NodeID voted_for_;
|
||||
Log log_;
|
||||
|
||||
static IDynamicNodeIDStorageBackend::String getCurrentTermKey() { return "current_term"; }
|
||||
static IDynamicNodeIDStorageBackend::String getVotedForKey() { return "voted_for"; }
|
||||
|
||||
public:
|
||||
PersistentState(IDynamicNodeIDStorageBackend& storage)
|
||||
: storage_(storage)
|
||||
@@ -211,12 +214,12 @@ public:
|
||||
/**
|
||||
* Invokes storage IO.
|
||||
*/
|
||||
void setCurrentTerm(Term term);
|
||||
int setCurrentTerm(Term term);
|
||||
|
||||
/**
|
||||
* Invokes storage IO.
|
||||
*/
|
||||
void setVotedFor(NodeID node_id);
|
||||
int setVotedFor(NodeID node_id);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user