libbio
Loading...
Searching...
No Matches
Typedefs | Functions
bio::physical::detail Namespace Reference

Typedefs

typedef uintptr_t IndexValue
 

Functions

IndexValue LookupPerspectiveName (const void *perspective, const ::std::string &key)
 
void StorePerspectiveName (const void *perspective, const ::std::string &key, IndexValue value)
 
void ErasePerspectiveEntries (const void *perspective)
 

Detailed Description

Process-wide side-table backing the Perspective<DIMENSION> name->Id fast path. Defined OUT OF LINE in NameIndex.cpp so that Perspective<DIMENSION>'s class layout never grows when the index gains features — consumers (libeons, elder, downstream services) need not be recompiled when the implementation changes here.

Storage is Meyers-singleton-style (function-local static) inside NameIndex.cpp. Lookup, store, and erase serialize through a single recursive_mutex; the typical perspective workload (a few singletons, mostly read-after-write) does not contend on this.

Values are type-erased to ::std::uintptr_t. Perspective casts back to its DIMENSION (an unsigned integer type that fits within uintptr_t on every platform bio supports).

Returns 0 (the InvalidId() sentinel for every Perspective<DIMENSION> instantiation) when the (perspective, key) pair is not present.

Typedef Documentation

◆ IndexValue

Function Documentation

◆ ErasePerspectiveEntries()

void bio::physical::detail::ErasePerspectiveEntries ( const void perspective)

Drop every entry the registry holds for the given perspective.
Called by ~Perspective so that an instance constructed at the same address later doesn't inherit stale entries.

◆ LookupPerspectiveName()

IndexValue bio::physical::detail::LookupPerspectiveName ( const void perspective,
const ::std::string &  key 
)

◆ StorePerspectiveName()

void bio::physical::detail::StorePerspectiveName ( const void perspective,
const ::std::string &  key,
IndexValue  value 
)