10 (*this)(std::vector<double>());
14 assert( i < registeredCollections.size() );
15 std::shared_lock read_lock(registryMutex);
16 return registeredCollections[i];
20 std::shared_lock read_lock(registryMutex);
21 if (
auto it = index.
find(collection);
28 std::unique_lock write_lock(registryMutex);
32 assert( index.
size() == registeredCollections.size() );
36 registeredCollections.push_back(collection);
38 assert( index.
size() == registeredCollections.size() );
39 return registeredCollections.size()-1;
43 std::shared_lock read_lock(registryMutex);
44 return registeredCollections.size();
48 std::unique_lock write_lock(registryMutex);
50 registeredCollections.clear();
52 index.
emplace(std::vector<double>(),0);
53 registeredCollections.push_back(std::vector<double>());
55 assert( index.
size() == registeredCollections.size() );
CollectionRegistry collectionRegistry
iterator find(const Key &key)
std::pair< iterator, bool > emplace(const Key &key, const Value &value)
size_type size() const noexcept
std::pair< iterator, bool > try_emplace(const Key &key, const Value &value)
Utility class for representing collections by numeric values.
const std::vector< double > & operator[](size_t i) const
Operator providing access to a registered collections by index.
size_t operator()(const std::vector< double > &collection)
Operator to register a collection by its values and return its index.
CollectionRegistry()
Constructor adds empty collection at index 0.