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

◆ expose_live_indexed()

template<typename T >
bool MayaFlux::expose_live_indexed ( std::string_view  prefix,
const std::shared_ptr< T > &  obj 
)
noexcept

Exposes obj under the first free key of the form "prefix_N".

N starts at 0 and advances past keys already in the arena, so every call site sharing a prefix, such as the overloads of one Creator factory, draws from one sequence and none of them collide.

Template Parameters
TType of the object.
Parameters
prefixKey prefix.
objshared_ptr to the existing object.
Returns
true on success, false if the directory is full.

Definition at line 391 of file LiveArena.hpp.

392{
393 if (internal::live_arena_header()->entry_count >= internal::LIVE_ARENA_MAX_ENTRIES) {
394 return false;
395 }
396
397 char key[internal::LIVE_ARENA_KEY_MAX];
398 for (uint32_t index = 0; index < internal::LIVE_ARENA_MAX_ENTRIES; ++index) {
399 internal::live_format_key(key, prefix, index);
400 if (internal::live_arena_expose(key, std::static_pointer_cast<void>(obj))) {
401 return true;
402 }
403 }
404 return false;
405}
uint32_t index
Definition VKDevice.cpp:122

References index, MayaFlux::internal::live_arena_expose(), MayaFlux::internal::live_arena_header(), MayaFlux::internal::LIVE_ARENA_KEY_MAX, MayaFlux::internal::LIVE_ARENA_MAX_ENTRIES, and MayaFlux::internal::live_format_key().

+ Here is the call graph for this function: