31 return a.is_equal_to(
b);
35 virtual bool is_equal_to(
const Key &other)
const = 0;
49 void add(std::unique_ptr<Key> key, std::unique_ptr<Value> value);
52 FunctionRef<std::unique_ptr<Value>()> create_value);
59 return dynamic_cast<T &
>(
60 this->
lookup_or_add(std::move(key), []() {
return std::make_unique<T>(); }));
friend bool operator==(const Key &a, const Key &b)
virtual uint64_t hash() const =0
T & lookup_or_add(std::unique_ptr< Key > key)
Value * lookup(const Key &key)
void add(std::unique_ptr< Key > key, std::unique_ptr< Value > value)
Value & lookup_or_add(std::unique_ptr< Key > key, FunctionRef< std::unique_ptr< Value >()> create_value)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
unsigned __int64 uint64_t