Open Search
    weakrefservices.h File Reference

    Classes

    struct  MemoryMetadataProxy
     
    class  WeakRefServices
     

    Namespaces

     maxon
     

    Typedefs

    using MemoryObserverCallback = MEMORY_OBSERVER_FLAGS(*)(void *callbackData, const void *target, MEMORY_OBSERVER_STATE state)
     
    using MemoryMetadataDestructor = void(*)(void *metadata)
     

    Enumerations

    enum class  MEMORY_OBSERVER_FLAGS : Int {
      DEFAULT ,
      CLAIM_SHARED_OWNERSHIP ,
      CLAIM_EXCLUSIVE_OWNERSHIP ,
      KEEP_OBSERVER ,
      INVOKE_WITH_UNLOCKED_TARGET
    }
     
    enum class  MEMORY_OBSERVER_STATE : Int {
      DEFAULT ,
      TARGET_IS_LOCKED ,
      TARGET_HAS_EXCLUSIVE_OWNERSHIP
    }
     

    Functions

    enum maxon::MEMORY_OBSERVER_FLAGS Int MAXON_ENUM_FLAGS (MEMORY_OBSERVER_FLAGS)
     
    enum maxon::MEMORY_OBSERVER_STATE Int MAXON_ENUM_FLAGS (MEMORY_OBSERVER_STATE)
     

    Variables

     DEFAULT
     
     CLAIM_SHARED_OWNERSHIP
     
     CLAIM_EXCLUSIVE_OWNERSHIP
     
     KEEP_OBSERVER
     
     INVOKE_WITH_UNLOCKED_TARGET
     
     TARGET_IS_LOCKED
     
     TARGET_HAS_EXCLUSIVE_OWNERSHIP
     

    Variable Documentation

    ◆ DEFAULT

    DEFAULT

    Default behaviour: Continue with destruction, observer will be removed.

    ◆ CLAIM_SHARED_OWNERSHIP

    CLAIM_SHARED_OWNERSHIP

    The observer claims shared ownership of the target, do not destruct the object.

    ◆ CLAIM_EXCLUSIVE_OWNERSHIP

    CLAIM_EXCLUSIVE_OWNERSHIP

    The first observer/creator claims exclusive ownership of the target, do not destruct the object.

    ◆ KEEP_OBSERVER

    KEEP_OBSERVER

    Do not delete the observer (usually only makes sense if ownership is claimed).

    ◆ INVOKE_WITH_UNLOCKED_TARGET

    INVOKE_WITH_UNLOCKED_TARGET

    Ask to invoke the observer again without the target being locked (if you need to destruct associated objects).

    ◆ TARGET_IS_LOCKED

    TARGET_IS_LOCKED

    The target is locked and you must not directly or indireclty modify itself or any related objects.

    ◆ TARGET_HAS_EXCLUSIVE_OWNERSHIP

    TARGET_HAS_EXCLUSIVE_OWNERSHIP

    The target is exclusively owned and you cannot claim shared ownership.