summaryrefslogtreecommitdiff
path: root/indra/llcommon/llregistry.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llregistry.h')
-rw-r--r--indra/llcommon/llregistry.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/indra/llcommon/llregistry.h b/indra/llcommon/llregistry.h
index 36ce6a97b7..36d7f7a44c 100644
--- a/indra/llcommon/llregistry.h
+++ b/indra/llcommon/llregistry.h
@@ -31,6 +31,7 @@
#include <boost/type_traits.hpp>
#include "llsingleton.h"
+#include "lltypeinfolookup.h"
template <typename T>
class LLRegistryDefaultComparator
@@ -38,6 +39,24 @@ class LLRegistryDefaultComparator
bool operator()(const T& lhs, const T& rhs) { return lhs < rhs; }
};
+template <typename KEY, typename VALUE>
+struct LLRegistryMapSelector
+{
+ typedef std::map<KEY, VALUE> type;
+};
+
+template <typename VALUE>
+struct LLRegistryMapSelector<std::type_info*, VALUE>
+{
+ typedef LLTypeInfoLookup<VALUE> type;
+};
+
+template <typename VALUE>
+struct LLRegistryMapSelector<const std::type_info*, VALUE>
+{
+ typedef LLTypeInfoLookup<VALUE> type;
+};
+
template <typename KEY, typename VALUE, typename COMPARATOR = LLRegistryDefaultComparator<KEY> >
class LLRegistry
{
@@ -53,7 +72,7 @@ public:
{
friend class LLRegistry<KEY, VALUE, COMPARATOR>;
public:
- typedef typename std::map<KEY, VALUE> registry_map_t;
+ typedef typename LLRegistryMapSelector<KEY, VALUE>::type registry_map_t;
bool add(ref_const_key_t key, ref_const_value_t value)
{