diff options
Diffstat (limited to 'indra/llcommon/llregistry.h')
| -rw-r--r-- | indra/llcommon/llregistry.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h index 35335e1213..92f8ae3245 100644 --- a/indra/llcommon/llregistry.h +++ b/indra/llcommon/llregistry.h @@ -32,21 +32,11 @@ #include "llsingleton.h" #include "llstl.h" -template <typename T> -struct LLRegistryDefaultComparator -{ - bool operator()(const T& lhs, const T& rhs) const - { - using std::less; - return less<T>()(lhs, rhs); - } -}; - -template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> > +template <typename KEY, typename VALUE> class LLRegistry { public: - typedef LLRegistry<KEY, VALUE, COMPARATOR> registry_t; + typedef LLRegistry<KEY, VALUE> registry_t; typedef const KEY& ref_const_key_t; typedef const VALUE& ref_const_value_t; typedef const VALUE* ptr_const_value_t; @@ -54,9 +44,9 @@ public: class Registrar { - friend class LLRegistry<KEY, VALUE, COMPARATOR>; + friend class LLRegistry<KEY, VALUE>; public: - typedef std::map<KEY, VALUE, COMPARATOR> registry_map_t; + typedef std::map<KEY, VALUE> registry_map_t; bool add(ref_const_key_t key, ref_const_value_t value) { @@ -234,9 +224,9 @@ private: Registrar mDefaultRegistrar; }; -template <typename KEY, typename VALUE, typename DERIVED_TYPE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> > +template <typename KEY, typename VALUE, typename DERIVED_TYPE> class LLRegistrySingleton - : public LLRegistry<KEY, VALUE, COMPARATOR>, + : public LLRegistry<KEY, VALUE>, public LLSingleton<DERIVED_TYPE> { // This LLRegistrySingleton doesn't use LLSINGLETON(LLRegistrySingleton) @@ -244,7 +234,7 @@ class LLRegistrySingleton // LLRegistrySingleton. So each concrete subclass needs // LLSINGLETON(whatever) -- not this intermediate base class. public: - typedef LLRegistry<KEY, VALUE, COMPARATOR> registry_t; + typedef LLRegistry<KEY, VALUE> registry_t; typedef const KEY& ref_const_key_t; typedef const VALUE& ref_const_value_t; typedef VALUE* ptr_value_t; @@ -309,7 +299,7 @@ public: }; // convenience functions - typedef typename LLRegistry<KEY, VALUE, COMPARATOR>::Registrar& ref_registrar_t; + typedef typename LLRegistry<KEY, VALUE>::Registrar& ref_registrar_t; static ref_registrar_t currentRegistrar() { return singleton_t::instance().registry_t::currentRegistrar(); |
