summaryrefslogtreecommitdiff
path: root/indra/llcommon/lltypeinfolookup.h
AgeCommit message (Collapse)Author
2013-05-05Spring cleaning: removed unused .cpp and.h files, and cleaned up header ↵Richard Linden
dependencies
2012-07-16MAINT-1175: Pass boost::unordered_map hash/equals functors for char*.Nat Goodspeed
boost::unordered_map<const char*, ...> does NOT, by default, "do the right thing." Give it hash and equality functors that do.
2012-07-11MAINT-1175: Change LLTypeInfoLookup API for future optimizations.Nat Goodspeed
Per discussion with Richard, accept the type key for insert() and find() as a template parameter rather than as std::type_info*. This permits (e.g.) some sort of compile-time prehashing for common types, without changing the API. Eliminate iterators from the API altogether, thus avoiding costs associated with transform_iterator. Fix existing references in llinitparam.h.
2012-07-10MAINT-1175: Still grappling with MSVC idiosyncracies.Nat Goodspeed
Maybe it's failing to correctly handle overloaded transform() methods?
2012-07-10MAINT-1175: Fix Windows build.Nat Goodspeed
It seems MSVC doesn't like boost::make_transform_iterator() in the context I was using it. Try directly invoking the iterator's constructor.
2012-07-10MAINT-1175: Reimplement LLTypeInfoLookup for better lookup failure.Nat Goodspeed
The original LLTypeInfoLookup implementation was based on two assumptions: small overall container size, and infrequent normal-case lookup failures. Those assumptions led to binary-searching a sorted vector, with linear search as a fallback to cover the problem case of two different type_info* values for the same type. As documented in the Jira, this turned out to be a problem. The container size was larger than expected, and failed lookups turned out to be far more common than expected. The new implementation is based on a hash map of std::type_info::name() strings, which should perform equally well in the success and failure cases: no special-case fallback logic.
2012-04-12Fix misleading comments, per Richard's code review.Nat Goodspeed
2012-04-11Fix Linux UI issues introduced by moving llinitparam to llcommon.Nat Goodspeed
In a number of places, the viewer uses a lookup based on std::type_info*. We used to use std::map<std::type_info*, whatever>. But on Linux, &typeid(SomeType) can produce different pointer values, depending on the dynamic load module in which the code is executed. Introduce LLTypeInfoLookup<T>, with an API that deliberately mimics std::map<std::type_info*, T>. LLTypeInfoLookup::find() first tries an efficient search for the specified std::type_info*. But if that fails, it scans the underlying container for a match on the std::type_info::name() string. If found, it caches the new std::type_info* to optimize subsequent lookups with the same pointer. Use LLTypeInfoLookup instead of std::map<std::type_info*, ...> in llinitparam.h and llregistry.h. Introduce LLSortedVector<KEY, VALUE>, a std::vector<std::pair<KEY, VALUE>> maintained in sorted order with binary-search lookup. It presents a subset of the std::map<KEY, VALUE> API.