MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ store() [2/3]

template<typename T >
std::shared_ptr< T > MayaFlux::store ( std::string_view  key,
std::shared_ptr< T >  obj 
)

Transfer ownership of an existing object to the persistent store and expose it to the live arena under key.

The persistent store retains the object for process lifetime. The live arena entry allows JIT'd code to reach the object via live_cast<T>(key). No-op on the arena side when MAYAFLUX_LIVE is not defined.

Template Parameters
TAny type managed by shared_ptr.
Parameters
keyArena key used to locate the object from JIT'd code.
objObject to retain and expose.
Returns
The same shared_ptr, allowing inline chaining.

Definition at line 48 of file Persist.hpp.

49{
50 MF_LIVE_EXPOSE(key.data(), obj);
51 internal::persistent_store().push_back(std::static_pointer_cast<void>(obj));
52 return obj;
53}
#define MF_LIVE_EXPOSE(key, ptr)
Exposes ptr to the live arena under a user-supplied key when MAYAFLUX_LIVE is defined.

References MF_LIVE_EXPOSE, and MayaFlux::internal::persistent_store().

+ Here is the call graph for this function: