Alert layer should handle alerts by UUID if messages are received out of sequence

This commit is contained in:
Dan Paulat 2025-04-05 08:14:18 -05:00
parent 3f83c8e4a9
commit 16507adbe9
5 changed files with 46 additions and 7 deletions

View file

@ -13,6 +13,8 @@
#include <memory>
#include <string>
#include <boost/uuid/uuid.hpp>
namespace scwx
{
namespace awips
@ -94,6 +96,7 @@ public:
TextProductMessage(TextProductMessage&&) noexcept;
TextProductMessage& operator=(TextProductMessage&&) noexcept;
boost::uuids::uuid uuid() const;
std::string message_content() const;
std::shared_ptr<WmoHeader> wmo_header() const;
std::vector<std::string> mnd_header() const;

View file

@ -9,6 +9,7 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
#include <boost/uuid/random_generator.hpp>
#include <re2/re2.h>
namespace scwx::awips
@ -53,6 +54,8 @@ public:
TextProductMessageImpl(const TextProductMessageImpl&&) = delete;
TextProductMessageImpl& operator=(const TextProductMessageImpl&&) = delete;
boost::uuids::uuid uuid_ {boost::uuids::random_generator()()};
std::string messageContent_;
std::shared_ptr<WmoHeader> wmoHeader_;
std::vector<std::string> mndHeader_;
@ -70,6 +73,11 @@ TextProductMessage::TextProductMessage(TextProductMessage&&) noexcept = default;
TextProductMessage&
TextProductMessage::operator=(TextProductMessage&&) noexcept = default;
boost::uuids::uuid TextProductMessage::uuid() const
{
return p->uuid_;
}
std::string TextProductMessage::message_content() const
{
return p->messageContent_;