25 #ifndef SRC_XRDEC_XRDECCONFIG_HH_
26 #define SRC_XRDEC_XRDECCONFIG_HH_
32 #include <unordered_map>
58 key += std::to_string( objcfg.
nbchunks );
60 key += std::to_string( objcfg.
nbparity );
62 key += std::to_string( uint8_t( objcfg.
datasize ) );
64 std::unique_lock<std::mutex> lck( mtx );
65 auto itr = redundancies.find( key );
66 if( itr == redundancies.end() )
68 auto p = redundancies.emplace( std::piecewise_construct,
69 std::forward_as_tuple(key),
70 std::forward_as_tuple(objcfg) );
71 return p.first->second;
81 std::unordered_map<std::string, RedundancyProvider> redundancies;
Class for computing parities and recovering data.
Global configuration for the EC module.
RedundancyProvider & GetRedundancy(const ObjCfg &objcfg)
Get redundancy provider for given data object configuration.
static Config & Instance()
Singleton access.