11// includes -----------------------------------------------------------------------------------------------------------
22
33extern " C" {
4+ #include < saitypes.h>
45#include < saiobject.h>
56#include < saistatus.h>
6- #include < saitypes .h>
7+ #include < saihash .h>
78#include < saiswitch.h>
89}
910
1011#include < cstdint>
1112#include < string>
1213#include < vector>
1314#include < set>
15+ #include < unordered_map>
1416#include < algorithm>
1517
1618#include < sai_serialize.h>
@@ -81,28 +83,28 @@ extern sai_object_id_t gSwitchId;
8183
8284// functions ----------------------------------------------------------------------------------------------------------
8385
84- static std::string toStr (sai_object_type_t objType, sai_attr_id_t attrId) noexcept
86+ static std::string toStr (sai_object_type_t objType, sai_attr_id_t attrId)
8587{
8688 const auto *meta = sai_metadata_get_attr_metadata (objType, attrId);
8789
8890 return meta != nullptr ? meta->attridname : " UNKNOWN" ;
8991}
9092
91- static std::string toStr (sai_native_hash_field_t value) noexcept
93+ static std::string toStr (sai_native_hash_field_t value)
9294{
9395 const auto *name = sai_metadata_get_native_hash_field_name (value);
9496
9597 return name != nullptr ? name : " UNKNOWN" ;
9698}
9799
98- static std::string toStr (sai_hash_algorithm_t value) noexcept
100+ static std::string toStr (sai_hash_algorithm_t value)
99101{
100102 const auto *name = sai_metadata_get_hash_algorithm_name (value);
101103
102104 return name != nullptr ? name : " UNKNOWN" ;
103105}
104106
105- static std::string toStr (const std::set<sai_native_hash_field_t > &value) noexcept
107+ static std::string toStr (const std::set<sai_native_hash_field_t > &value)
106108{
107109 std::vector<std::string> strList;
108110
@@ -118,7 +120,7 @@ static std::string toStr(const std::set<sai_native_hash_field_t> &value) noexcep
118120 return join (" ," , strList.cbegin (), strList.cend ());
119121}
120122
121- static std::string toStr (const std::set<sai_hash_algorithm_t > &value) noexcept
123+ static std::string toStr (const std::set<sai_hash_algorithm_t > &value)
122124{
123125 std::vector<std::string> strList;
124126
@@ -134,13 +136,13 @@ static std::string toStr(const std::set<sai_hash_algorithm_t> &value) noexcept
134136 return join (" ," , strList.cbegin (), strList.cend ());
135137}
136138
137- static std::string toStr (bool value) noexcept
139+ static std::string toStr (bool value)
138140{
139141 return value ? " true" : " false" ;
140142}
141143
142144template <typename T1, typename T2>
143- static void insertBack (T1 &out, const T2 &in) noexcept
145+ static void insertBack (T1 &out, const T2 &in)
144146{
145147 out.insert (out.end (), in.cbegin (), in.cend ());
146148}
0 commit comments