Context for rendering generated objects.
- Companion
- object
Value members
Abstract methods
Acquires a resource associated with an object.
The resource is stored under the key obj.id
,
and an internal use count is maintained, calling
dispose
on the resource if the count goes
back to zero.
Acquires a resource associated with an object.
The resource is stored under the key obj.id
,
and an internal use count is maintained, calling
dispose
on the resource if the count goes
back to zero.
- Type Params
- A
the type of resource which must be a
Disposable
- Value Params
- init
the function that produces the resource if it was not yet in the cache
- obj
the object used as a look-up key
- Returns
the resource, either already found in the cache or newly produced
Attempts to find a resource associated with an object.
Attempts to find a resource associated with an object.
- Type Params
- A
the type of resource
- Value Params
- obj
the object used as a look-up key
- Returns
the resource, if it was found in the cache, or
None
Releases a resource associated with an object.
This decreases the use count of the resource, and
calls dispose
on it if the count goes back to zero.
Releases a resource associated with an object.
This decreases the use count of the resource, and
calls dispose
on it if the count goes back to zero.
- Value Params
- obj
the object used as a look-up key