Communication Library for Autonomous Systems v1.0
Reliable and secure communication library for autonomous vehicle systems
|
Thread-safe singleton for leader key storage. More...
#include <leaderKeyStorage.h>
Public Member Functions | |
void | setLeaderId (const Ethernet::Address &leader_id) |
Set the current leader ID. | |
Ethernet::Address | getLeaderId () const |
Get the current leader ID. | |
void | setGroupMacKey (const MacKeyType &key) |
Set the current group MAC key. | |
MacKeyType | getGroupMacKey () const |
Get the current group MAC key. | |
std::chrono::steady_clock::time_point | getLastUpdateTime () const |
Get the last update time. | |
Static Public Member Functions | |
static LeaderKeyStorage & | getInstance () |
Get the singleton instance. | |
Thread-safe singleton for leader key storage.
This class is thread-safe and can be accessed from multiple threads. All public methods are protected by mutex locks. The singleton instance is initialized in a thread-safe manner using C++11's static initialization guarantees.
|
inline |
Get the current group MAC key.
Thread-safe: Protected by mutex
|
inlinestatic |
Get the singleton instance.
Thread-safe: Uses C++11's static initialization guarantees
|
inline |
Get the last update time.
Thread-safe: Uses atomic operations
|
inline |
Get the current leader ID.
Thread-safe: Protected by mutex
|
inline |
Set the current group MAC key.
key | The new MAC key |
Thread-safe: Protected by mutex
|
inline |
Set the current leader ID.
leader_id | The MAC address of the new leader |
Thread-safe: Protected by mutex