mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 02:40:05 +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
				
			
		|  | @ -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
 | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat