#include <weakrefservices.h>
Proxy object to access memory metadata. While the proxy object exists the metadata for the target is locked and cannot be accessed or modified by other threads (in fact all metadata for the target including weak references is locked). Therefore best practice is to destroy the proxy object as soon as possible.
Public Member Functions | |
MAXON_DISALLOW_COPY_AND_ASSIGN (MemoryMetadataProxy) | |
MemoryMetadataProxy ()=default | |
MemoryMetadataProxy (MemoryMetadataProxy &&)=default | |
MemoryMetadataProxy (WeakRefTargetBase *weakRefTarget, void *metadata) | |
MAXON_OPERATOR_MOVE_ASSIGNMENT (MemoryMetadataProxy) | |
~MemoryMetadataProxy () | |
operator Bool () const | |
Result< void * > | Get () const |
Private Attributes | |
WeakRefTargetBase * | _weakRefTarget |
void * | _metadata |
|
default |
|
default |
|
explicit |
~MemoryMetadataProxy | ( | ) |
Destructs the proxy object and unlocks access to the metadata.
MAXON_DISALLOW_COPY_AND_ASSIGN | ( | MemoryMetadataProxy | ) |
MAXON_OPERATOR_MOVE_ASSIGNMENT | ( | MemoryMetadataProxy | ) |
|
explicit |
Result<void*> Get | ( | void | ) | const |
Returns the memory metadata (or an error if there wasn't any).
|
private |
|
private |