MCPcopy Create free account
hub / github.com/ImageEngine/cortex / CacheGetterKey

Class CacheGetterKey

src/IECoreGL/CachedConverter.cpp:60–86  ·  view source on GitHub ↗

Conceptually the key for the cache is just the hash of the object, but the getter also needs the object to be converted, so we take advantage of the LRUCache's GetterKey feature which allows an augmented key to be passed to the getter, while a simpler key is stored internally.

Source from the content-addressed store, hash-verified

58// feature which allows an augmented key to be passed to the
59// getter, while a simpler key is stored internally.
60struct CacheGetterKey
61{
62
63 CacheGetterKey()
64 : object( nullptr )
65 {
66 }
67
68 CacheGetterKey( const IECore::Object *o )
69 : object( o ), hash( o->hash() )
70 {
71 }
72
73 bool operator == ( const CacheGetterKey &other ) const
74 {
75 return hash == other.hash;
76 }
77
78 operator const IECore::MurmurHash & () const
79 {
80 return hash;
81 }
82
83 const IECore::Object *object;
84 const IECore::MurmurHash hash;
85
86};
87
88} // namespace
89

Callers 1

convertMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected