4#ifndef _Stroika_Foundation_Containers_Concrete_KeyedCollection_Factory_h_
5#define _Stroika_Foundation_Containers_Concrete_KeyedCollection_Factory_h_
7#include "Stroika/Foundation/StroikaPreComp.h"
16 template <
typename T,
typename KEY_TYPE,
typename TRAITS>
17 class KeyedCollection;
20namespace Stroika::Foundation::Containers::Factory {
29 template <
typename T,
typename KEY_TYPE,
typename TRAITS,
typename KEY_EQUALS_COMPARER = equal_to<KEY_TYPE>>
32 static_assert (not is_reference_v<T> and not is_reference_v<KEY_TYPE> and not is_reference_v<KEY_EQUALS_COMPARER>,
33 "typically if this fails its because a (possibly indirect) caller forgot to use forward<TTT>(), or remove_cvref_t");
57 optional<bool> fOptimizeForLookupSpeedOverUpdateSpeed;
83 nonvirtual
ConstructedType operator() (
const KeyExtractorType& keyExtractor,
const KEY_EQUALS_COMPARER& keyComparer)
const;
106 static void Register (
const optional<KeyedCollection_Factory>& f = nullopt);
123#include "KeyedCollection_Factory.inl"
Singleton factory object - Used to create the default backend implementation of a KeyedCollection<> c...
nonvirtual ConstructedType operator()(const KeyExtractorType &keyExtractor, const KEY_EQUALS_COMPARER &keyComparer) const
static void Register(const optional< KeyedCollection_Factory > &f=nullopt)
KeyedCollection< T, KEY_TYPE, TRAITS > ConstructedType
function< ConstructedType(const KeyExtractorType &keyExtractor, const KEY_EQUALS_COMPARER &keyComparer)> FactoryFunctionType
static const KeyedCollection_Factory & Default()
constexpr KeyedCollection_Factory()
a cross between Mapping<KEY, T> and Collection<T> and Set<T>
typename TRAITS::KeyExtractorType KeyExtractorType