mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-08 13:27:57 +00:00
[traffxml] Store message cache in file
So far only API and tests, and without decoded segments Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -107,6 +107,12 @@ void TrafficManager::Teardown()
|
||||
m_thread.join();
|
||||
}
|
||||
|
||||
std::map<std::string, traffxml::TraffMessage> TrafficManager::GetMessageCache()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_mutex);
|
||||
return m_messageCache;
|
||||
}
|
||||
|
||||
TrafficManager::TrafficState TrafficManager::GetState() const
|
||||
{
|
||||
return m_state;
|
||||
|
||||
@@ -111,6 +111,17 @@ public:
|
||||
|
||||
void Teardown();
|
||||
|
||||
/**
|
||||
* @brief Returns a copy of the cache of all currently active TraFF messages.
|
||||
*
|
||||
* For testing purposes.
|
||||
*
|
||||
* Keys are message IDs, values are messages.
|
||||
*
|
||||
* This method is safe to call from any thread.
|
||||
*/
|
||||
std::map<std::string, traffxml::TraffMessage> GetMessageCache();
|
||||
|
||||
TrafficState GetState() const;
|
||||
void SetStateListener(TrafficStateChangedFn const & onStateChangedFn);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user