mirror of
				https://github.com/ciphervance/supercell-wx.git
				synced 2025-10-31 06:40:05 +00:00 
			
		
		
		
	Return static constant data by constant reference
This commit is contained in:
		
							parent
							
								
									a202e0e2a0
								
							
						
					
					
						commit
						c47a569645
					
				
					 6 changed files with 16 additions and 16 deletions
				
			
		|  | @ -69,8 +69,8 @@ enum class Phenomenon | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Phenomenon         GetPhenomenon(const std::string& code); | Phenomenon         GetPhenomenon(const std::string& code); | ||||||
| std::string GetPhenomenonCode(Phenomenon phenomenon); | const std::string& GetPhenomenonCode(Phenomenon phenomenon); | ||||||
| std::string GetPhenomenonText(Phenomenon phenomenon); | const std::string& GetPhenomenonText(Phenomenon phenomenon); | ||||||
| 
 | 
 | ||||||
| } // namespace awips
 | } // namespace awips
 | ||||||
| } // namespace scwx
 | } // namespace scwx
 | ||||||
|  |  | ||||||
|  | @ -62,10 +62,10 @@ public: | ||||||
|    bool Parse(const std::string& s); |    bool Parse(const std::string& s); | ||||||
| 
 | 
 | ||||||
|    static ProductType        GetProductType(const std::string& code); |    static ProductType        GetProductType(const std::string& code); | ||||||
|    static std::string GetProductTypeCode(ProductType productType); |    static const std::string& GetProductTypeCode(ProductType productType); | ||||||
| 
 | 
 | ||||||
|    static Action             GetAction(const std::string& code); |    static Action             GetAction(const std::string& code); | ||||||
|    static std::string GetActionCode(Action action); |    static const std::string& GetActionCode(Action action); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|    std::unique_ptr<PVtecImpl> p; |    std::unique_ptr<PVtecImpl> p; | ||||||
|  |  | ||||||
|  | @ -20,8 +20,8 @@ enum class Significance | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| Significance       GetSignificance(const std::string& code); | Significance       GetSignificance(const std::string& code); | ||||||
| std::string  GetSignificanceCode(Significance significance); | const std::string& GetSignificanceCode(Significance significance); | ||||||
| std::string  GetSignificanceText(Significance significance); | const std::string& GetSignificanceText(Significance significance); | ||||||
| 
 | 
 | ||||||
| } // namespace awips
 | } // namespace awips
 | ||||||
| } // namespace scwx
 | } // namespace scwx
 | ||||||
|  |  | ||||||
|  | @ -154,12 +154,12 @@ Phenomenon GetPhenomenon(const std::string& code) | ||||||
|    return phenomenon; |    return phenomenon; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string GetPhenomenonCode(Phenomenon phenomenon) | const std::string& GetPhenomenonCode(Phenomenon phenomenon) | ||||||
| { | { | ||||||
|    return phenomenonCodes_.left.at(phenomenon); |    return phenomenonCodes_.left.at(phenomenon); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string GetPhenomenonText(Phenomenon phenomenon) | const std::string& GetPhenomenonText(Phenomenon phenomenon) | ||||||
| { | { | ||||||
|    return phenomenonText_.at(phenomenon); |    return phenomenonText_.at(phenomenon); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -242,7 +242,7 @@ PVtec::ProductType PVtec::GetProductType(const std::string& code) | ||||||
|    return productType; |    return productType; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string PVtec::GetProductTypeCode(PVtec::ProductType productType) | const std::string& PVtec::GetProductTypeCode(PVtec::ProductType productType) | ||||||
| { | { | ||||||
|    return productTypeCodes_.left.at(productType); |    return productTypeCodes_.left.at(productType); | ||||||
| } | } | ||||||
|  | @ -266,7 +266,7 @@ PVtec::Action PVtec::GetAction(const std::string& code) | ||||||
|    return action; |    return action; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string PVtec::GetActionCode(PVtec::Action action) | const std::string& PVtec::GetActionCode(PVtec::Action action) | ||||||
| { | { | ||||||
|    return actionCodes_.left.at(action); |    return actionCodes_.left.at(action); | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -56,12 +56,12 @@ Significance GetSignificance(const std::string& code) | ||||||
|    return significance; |    return significance; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string GetSignificanceCode(Significance significance) | const std::string& GetSignificanceCode(Significance significance) | ||||||
| { | { | ||||||
|    return significanceCodes_.left.at(significance); |    return significanceCodes_.left.at(significance); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| std::string GetSignificanceText(Significance significance) | const std::string& GetSignificanceText(Significance significance) | ||||||
| { | { | ||||||
|    return significanceText_.at(significance); |    return significanceText_.at(significance); | ||||||
| } | } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Dan Paulat
						Dan Paulat