mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 06:10:04 +00:00
Create dedicated Storm Tracking Information message type
This commit is contained in:
parent
3eab1405d2
commit
c8d8b24317
4 changed files with 101 additions and 1 deletions
|
|
@ -0,0 +1,39 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/wsr88d/rpg/graphic_product_message.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
class StormTrackingInformationMessage : public GraphicProductMessage
|
||||
{
|
||||
public:
|
||||
explicit StormTrackingInformationMessage();
|
||||
~StormTrackingInformationMessage();
|
||||
|
||||
StormTrackingInformationMessage(const StormTrackingInformationMessage&) =
|
||||
delete;
|
||||
StormTrackingInformationMessage&
|
||||
operator=(const StormTrackingInformationMessage&) = delete;
|
||||
|
||||
StormTrackingInformationMessage(StormTrackingInformationMessage&&) noexcept;
|
||||
StormTrackingInformationMessage&
|
||||
operator=(StormTrackingInformationMessage&&) noexcept;
|
||||
|
||||
bool Parse(std::istream& is) override;
|
||||
|
||||
static std::shared_ptr<StormTrackingInformationMessage>
|
||||
Create(Level3MessageHeader&& header, std::istream& is);
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
std::unique_ptr<Impl> p;
|
||||
};
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
#include <scwx/wsr88d/rpg/general_status_message.hpp>
|
||||
#include <scwx/wsr88d/rpg/graphic_product_message.hpp>
|
||||
#include <scwx/wsr88d/rpg/radar_coded_message.hpp>
|
||||
#include <scwx/wsr88d/rpg/storm_tracking_information_message.hpp>
|
||||
#include <scwx/wsr88d/rpg/tabular_product_message.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
|
@ -44,7 +45,7 @@ static const std::unordered_map<int, CreateLevel3MessageFunction> //
|
|||
{51, GraphicProductMessage::Create},
|
||||
{56, GraphicProductMessage::Create},
|
||||
{57, GraphicProductMessage::Create},
|
||||
{58, GraphicProductMessage::Create},
|
||||
{58, StormTrackingInformationMessage::Create},
|
||||
{59, GraphicProductMessage::Create},
|
||||
{61, GraphicProductMessage::Create},
|
||||
{62, TabularProductMessage::Create},
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
#include <scwx/wsr88d/rpg/storm_tracking_information_message.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace wsr88d
|
||||
{
|
||||
namespace rpg
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ =
|
||||
"scwx::wsr88d::rpg::storm_tracking_information_message";
|
||||
static const auto logger_ = util::Logger::Create(logPrefix_);
|
||||
|
||||
class StormTrackingInformationMessage::Impl
|
||||
{
|
||||
public:
|
||||
explicit Impl() {}
|
||||
~Impl() = default;
|
||||
};
|
||||
|
||||
StormTrackingInformationMessage::StormTrackingInformationMessage() :
|
||||
p(std::make_unique<Impl>())
|
||||
{
|
||||
}
|
||||
StormTrackingInformationMessage::~StormTrackingInformationMessage() = default;
|
||||
|
||||
StormTrackingInformationMessage::StormTrackingInformationMessage(
|
||||
StormTrackingInformationMessage&&) noexcept = default;
|
||||
StormTrackingInformationMessage& StormTrackingInformationMessage::operator=(
|
||||
StormTrackingInformationMessage&&) noexcept = default;
|
||||
|
||||
bool StormTrackingInformationMessage::Parse(std::istream& is)
|
||||
{
|
||||
bool dataValid = GraphicProductMessage::Parse(is);
|
||||
|
||||
return dataValid;
|
||||
}
|
||||
|
||||
std::shared_ptr<StormTrackingInformationMessage>
|
||||
StormTrackingInformationMessage::Create(Level3MessageHeader&& header,
|
||||
std::istream& is)
|
||||
{
|
||||
std::shared_ptr<StormTrackingInformationMessage> message =
|
||||
std::make_shared<StormTrackingInformationMessage>();
|
||||
message->set_header(std::move(header));
|
||||
|
||||
if (!message->Parse(is))
|
||||
{
|
||||
message.reset();
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
} // namespace rpg
|
||||
} // namespace wsr88d
|
||||
} // namespace scwx
|
||||
|
|
@ -158,6 +158,7 @@ set(HDR_WSR88D_RPG include/scwx/wsr88d/rpg/ccb_header.hpp
|
|||
include/scwx/wsr88d/rpg/special_graphic_symbol_packet.hpp
|
||||
include/scwx/wsr88d/rpg/sti_circle_symbol_packet.hpp
|
||||
include/scwx/wsr88d/rpg/storm_id_symbol_packet.hpp
|
||||
include/scwx/wsr88d/rpg/storm_tracking_information_message.hpp
|
||||
include/scwx/wsr88d/rpg/tabular_alphanumeric_block.hpp
|
||||
include/scwx/wsr88d/rpg/tabular_product_message.hpp
|
||||
include/scwx/wsr88d/rpg/text_and_special_symbol_packet.hpp
|
||||
|
|
@ -197,6 +198,7 @@ set(SRC_WSR88D_RPG source/scwx/wsr88d/rpg/ccb_header.cpp
|
|||
source/scwx/wsr88d/rpg/special_graphic_symbol_packet.cpp
|
||||
source/scwx/wsr88d/rpg/sti_circle_symbol_packet.cpp
|
||||
source/scwx/wsr88d/rpg/storm_id_symbol_packet.cpp
|
||||
source/scwx/wsr88d/rpg/storm_tracking_information_message.cpp
|
||||
source/scwx/wsr88d/rpg/tabular_alphanumeric_block.cpp
|
||||
source/scwx/wsr88d/rpg/tabular_product_message.cpp
|
||||
source/scwx/wsr88d/rpg/text_and_special_symbol_packet.cpp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue