HDK
|
#include <typeInfoMap.h>
Public Member Functions | |
TfTypeInfoMap () | |
bool | Exists (const std::type_info &key) const |
Return true if the given key is present in the map. More... | |
bool | Exists (const std::string &key) const |
VALUE * | Find (const std::type_info &key) const |
template<class Upgrader > | |
VALUE * | Find (const std::type_info &key, Upgrader &upgrader) |
VALUE * | Find (const std::string &key) const |
void | Set (const std::type_info &key, const VALUE &value) |
void | Set (const std::string &key, const VALUE &value) |
bool | CreateAlias (const std::string &alias, const std::string &key) |
bool | CreateAlias (const std::string &alias, const std::type_info &key) |
void | Remove (const std::type_info &key) |
Remove this key (and any aliases associated with it). More... | |
void | Remove (const std::string &key) |
Remove this key (and any aliases associated with it). More... | |
A map whose key is a const std::type_info&, or a string alias.
A TfTypeInfoMap
stores values of arbitrary type (template parameter VALUE) under a key that is either a const
std::type_info&
, or an std::string
. Note that the std::type_info
structure is many-to-one with respect to its name, i.e. two distinct instances of a std::type_info
can represent the same type. Thus, a naive implementation that does pointer comparison on the address of a std::type_info
can fail. The TfTypeInfoMap
takes care of this aliasing.
Additionally, the table lets one create additional string aliases for a given entry.
Definition at line 62 of file typeInfoMap.h.
|
inline |
Definition at line 69 of file typeInfoMap.h.
|
inline |
Create an alias for a key.
Queries with a key of alias
will return the same data associated with queries for key
.
If key
is not presently a member of the map, this function does nothing and returns false
.
Definition at line 164 of file typeInfoMap.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 173 of file typeInfoMap.h.
|
inline |
Return true if the given key is present in the map.
Definition at line 72 of file typeInfoMap.h.
|
inline |
Return true if the given key is present in the map.
Note that lookup by std::type_info
is preferable for speed reasons.
Definition at line 79 of file typeInfoMap.h.
|
inline |
Return a pointer to the value stored under key
, and NULL if key
is not a key in the map.
Definition at line 85 of file typeInfoMap.h.
|
inline |
Return a pointer to the value stored under key
, and NULL if key
is not a key in the map. For efficiency of future lookups this will cache the result if it falls back to a string based lookup. In that case before updating the cache it will call the functor upgrader
to allow the client to upgrade any lock to exclusive access.
Definition at line 101 of file typeInfoMap.h.
|
inline |
Return a pointer to the value stored under key
, and NULL if key
is not a key in the map.
Note that lookup by std::type_info
is preferable for speed reasons.
Definition at line 117 of file typeInfoMap.h.
|
inline |
Remove this key (and any aliases associated with it).
Definition at line 182 of file typeInfoMap.h.
|
inline |
Remove this key (and any aliases associated with it).
Definition at line 187 of file typeInfoMap.h.
|
inline |
Set the value for a given key.
Note that if key
is not already in the table, this creates a new entry. Also, key.name()
is automatically made linked with this entry, so that future queries can be made via key.name()
, though lookup by std::type_info
is greatly preferred.
Definition at line 128 of file typeInfoMap.h.
|
inline |
Set the value for a given key.
Note that if key
is not already in the table, this creates a new entry. Also, lookup by std::type_info
is preferable for speed reasons.
Definition at line 142 of file typeInfoMap.h.