template <typename T>
class SharedToken
Defined at line 21 of file ../../src/camera/lib/tokens/tokens.h
The SharedToken class associates an owned object with a thread-safe copyable deferred callback.
This can be used to tie an object to its associated release or cleanup methods. When all copies
of an instance are destroyed, the specified callback is invoked.
Public Methods
void SharedToken<T> (T object, fit::closure callback)
Creates a new SharedToken. Upon destruction of the last copy of an instance, the callback is
executed immediately.
Defined at line 25 of file ../../src/camera/lib/tokens/tokens.h
void SharedToken<T> (T object, fit::closure callback, async_dispatcher_t * dispatcher)
Creates a new SharedToken. Upon destruction of the last copy of an instance, the callback is
posted as a task on the specified dispatcher. If dispatcher is null, the default dispatcher for
the caller's thread is used.
Defined at line 34 of file ../../src/camera/lib/tokens/tokens.h
T & operator* ()
These methods return a reference/pointer to the shared owned object, which remains valid for
the lifetime of the linked token. This method is itself thread-safe, however the underlying
object that it returns may not be.
Defined at line 52 of file ../../src/camera/lib/tokens/tokens.h
T * operator-> ()
Defined at line 53 of file ../../src/camera/lib/tokens/tokens.h