| 625 | |
| 626 | template <typename T, bool use_dynamic_cast> |
| 627 | Status ResourceMgr::LookupInternal(const string& container, const string& name, |
| 628 | T** resource) const { |
| 629 | ResourceBase* found = nullptr; |
| 630 | Status s = DoLookup(container, MakeTypeIndex<T>(), name, &found); |
| 631 | if (s.ok()) { |
| 632 | // It's safe to down cast 'found' to T* since |
| 633 | // typeid(T).hash_code() is part of the map key. |
| 634 | *resource = TypeCastFunctor<T, use_dynamic_cast>::Cast(found); |
| 635 | } |
| 636 | return s; |
| 637 | } |
| 638 | |
| 639 | template <typename T, bool use_dynamic_cast> |
| 640 | Status ResourceMgr::LookupOrCreate(const string& container, const string& name, |