mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 16:10:04 +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
|
|
@ -68,9 +68,9 @@ enum class Phenomenon
|
|||
Unknown
|
||||
};
|
||||
|
||||
Phenomenon GetPhenomenon(const std::string& code);
|
||||
std::string GetPhenomenonCode(Phenomenon phenomenon);
|
||||
std::string GetPhenomenonText(Phenomenon phenomenon);
|
||||
Phenomenon GetPhenomenon(const std::string& code);
|
||||
const std::string& GetPhenomenonCode(Phenomenon phenomenon);
|
||||
const std::string& GetPhenomenonText(Phenomenon phenomenon);
|
||||
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ public:
|
|||
|
||||
bool Parse(const std::string& s);
|
||||
|
||||
static ProductType GetProductType(const std::string& code);
|
||||
static std::string GetProductTypeCode(ProductType productType);
|
||||
static ProductType GetProductType(const std::string& code);
|
||||
static const std::string& GetProductTypeCode(ProductType productType);
|
||||
|
||||
static Action GetAction(const std::string& code);
|
||||
static std::string GetActionCode(Action action);
|
||||
static Action GetAction(const std::string& code);
|
||||
static const std::string& GetActionCode(Action action);
|
||||
|
||||
private:
|
||||
std::unique_ptr<PVtecImpl> p;
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ enum class Significance
|
|||
Unknown
|
||||
};
|
||||
|
||||
Significance GetSignificance(const std::string& code);
|
||||
std::string GetSignificanceCode(Significance significance);
|
||||
std::string GetSignificanceText(Significance significance);
|
||||
Significance GetSignificance(const std::string& code);
|
||||
const std::string& GetSignificanceCode(Significance significance);
|
||||
const std::string& GetSignificanceText(Significance significance);
|
||||
|
||||
} // namespace awips
|
||||
} // namespace scwx
|
||||
|
|
|
|||
|
|
@ -154,12 +154,12 @@ Phenomenon GetPhenomenon(const std::string& code)
|
|||
return phenomenon;
|
||||
}
|
||||
|
||||
std::string GetPhenomenonCode(Phenomenon phenomenon)
|
||||
const std::string& GetPhenomenonCode(Phenomenon phenomenon)
|
||||
{
|
||||
return phenomenonCodes_.left.at(phenomenon);
|
||||
}
|
||||
|
||||
std::string GetPhenomenonText(Phenomenon phenomenon)
|
||||
const std::string& GetPhenomenonText(Phenomenon phenomenon)
|
||||
{
|
||||
return phenomenonText_.at(phenomenon);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,7 +242,7 @@ PVtec::ProductType PVtec::GetProductType(const std::string& code)
|
|||
return productType;
|
||||
}
|
||||
|
||||
std::string PVtec::GetProductTypeCode(PVtec::ProductType productType)
|
||||
const std::string& PVtec::GetProductTypeCode(PVtec::ProductType productType)
|
||||
{
|
||||
return productTypeCodes_.left.at(productType);
|
||||
}
|
||||
|
|
@ -266,7 +266,7 @@ PVtec::Action PVtec::GetAction(const std::string& code)
|
|||
return action;
|
||||
}
|
||||
|
||||
std::string PVtec::GetActionCode(PVtec::Action action)
|
||||
const std::string& PVtec::GetActionCode(PVtec::Action action)
|
||||
{
|
||||
return actionCodes_.left.at(action);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,12 +56,12 @@ Significance GetSignificance(const std::string& code)
|
|||
return significance;
|
||||
}
|
||||
|
||||
std::string GetSignificanceCode(Significance significance)
|
||||
const std::string& GetSignificanceCode(Significance significance)
|
||||
{
|
||||
return significanceCodes_.left.at(significance);
|
||||
}
|
||||
|
||||
std::string GetSignificanceText(Significance significance)
|
||||
const std::string& GetSignificanceText(Significance significance)
|
||||
{
|
||||
return significanceText_.at(significance);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue