mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-30 13:30:06 +00:00 
			
		
		
		
	Updating test product messages to expose additional details
This commit is contained in:
		
							parent
							
								
									3692ef75f2
								
							
						
					
					
						commit
						612874f830
					
				
					 7 changed files with 80 additions and 2 deletions
				
			
		|  | @ -40,6 +40,21 @@ public: | |||
| TextEventManager::TextEventManager() : p(std::make_unique<Impl>(this)) {} | ||||
| TextEventManager::~TextEventManager() = default; | ||||
| 
 | ||||
| size_t TextEventManager::message_count(const types::TextEventKey& key) const | ||||
| { | ||||
|    size_t messageCount = 0u; | ||||
| 
 | ||||
|    std::shared_lock lock(p->textEventMutex_); | ||||
| 
 | ||||
|    auto it = p->textEventMap_.find(key); | ||||
|    if (it != p->textEventMap_.cend()) | ||||
|    { | ||||
|       messageCount = it->second.size(); | ||||
|    } | ||||
| 
 | ||||
|    return messageCount; | ||||
| } | ||||
| 
 | ||||
| std::vector<std::shared_ptr<awips::TextProductMessage>> | ||||
| TextEventManager::message_list(const types::TextEventKey& key) const | ||||
| { | ||||
|  |  | |||
|  | @ -23,6 +23,7 @@ public: | |||
|    explicit TextEventManager(); | ||||
|    ~TextEventManager(); | ||||
| 
 | ||||
|    size_t message_count(const types::TextEventKey& key) const; | ||||
|    std::vector<std::shared_ptr<awips::TextProductMessage>> | ||||
|    message_list(const types::TextEventKey& key) const; | ||||
| 
 | ||||
|  |  | |||
|  | @ -13,9 +13,18 @@ namespace types | |||
| 
 | ||||
| static const std::string logPrefix_ = "scwx::qt::types::text_event_key"; | ||||
| 
 | ||||
| std::string TextEventKey::ToFullString() const | ||||
| { | ||||
|    return std::format("{} {} {} {:04}", | ||||
|                       officeId_, | ||||
|                       awips::GetPhenomenonText(phenomenon_), | ||||
|                       awips::GetSignificanceText(significance_), | ||||
|                       etn_); | ||||
| } | ||||
| 
 | ||||
| std::string TextEventKey::ToString() const | ||||
| { | ||||
|    return std::format("{}.{}.{}.{}", | ||||
|    return std::format("{}.{}.{}.{:04}", | ||||
|                       officeId_, | ||||
|                       awips::GetPhenomenonCode(phenomenon_), | ||||
|                       awips::GetSignificanceCode(significance_), | ||||
|  |  | |||
|  | @ -20,6 +20,7 @@ struct TextEventKey | |||
|    { | ||||
|    } | ||||
| 
 | ||||
|    std::string ToFullString() const; | ||||
|    std::string ToString() const; | ||||
|    bool        operator==(const TextEventKey& o) const; | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat