ScopedPtr

Takes ownership over the given pointer and handles it's lifetime. @note As [ScopedPtr](API\Plugins\RigLogicLib\pma\ScopedPtr) inherits the specified destroyer type, stateless lifetime managers are zero-cost, but it's also possible to use stateful lifetime managers (such as lambdas with captures and what-not). For stateful lifetime managers, a dedicated constructor exists that receives the destroyer instance and initializes the inherited destroyer type with it.

Windows
MacOS
Linux

Inheritance Hierarchy

TDestroyer

ScopedPtr

References

Module

RigLogicLib

Header

/Engine/Plugins/Animation/RigLogic/Source/RigLogicLib/Public/pma/ScopedPtr.h

Include

#include "pma/ScopedPtr.h"

Syntax

template<class T, class TDestroyer>
class ScopedPtr : private TDestroyer

Remarks

Takes ownership over the given pointer and handles it's lifetime. @note As ScopedPtr inherits the specified destroyer type, stateless lifetime managers are zero-cost, but it's also possible to use stateful lifetime managers (such as lambdas with captures and what-not). For stateful lifetime managers, a dedicated constructor exists that receives the destroyer instance and initializes the inherited destroyer type with it.

Constructors

Name Description

Public function

ScopedPtr()

Public function

ScopedPtr

(
    pointer ptr_
)

Public function

ScopedPtr

(
    std::nullptr_t
)

Public function

ScopedPtr

(
    const ScopedPtr&
)

Public function

ScopedPtr

(
    ScopedPtr&& rhs
)

Public function

ScopedPtr

(
    ScopedPtr< U, UDestroyer >&& rhs
)

Public function

ScopedPtr

(
    pointer ptr_,
    destroyer_type&& destroyer
)

Destructors

Name Description

Public function

~ScopedPtr()

Functions

Name Description

Public function Const

pointer

 

get()

Public function

pointer

 

release()

Public function

void

 

reset

(
    pointer rhs
)

Public function

void

 

swap

(
    ScopedPtr& rhs
)

Operators

Name Description

Public function Const

 

operator bool()

Public function Const

std::enable_...

 

operator*()

Public function Const

std::enable_...

 

operator[]

(
    std::size_t index
)

Public function

ScopedPtr &

 

operator=

(
    ScopedPtr< U, UDestroyer >&& rhs
)

Public function

ScopedPtr &

 

operator=

(
    ScopedPtr&& rhs
)

Public function

ScopedPtr &

 

operator=

(
    const ScopedPtr&
)

Public function

ScopedPtr &

 

operator=

(
    std::nullptr_t
)

Public function Const

pointer

 

operator->()

Typedefs

See Also

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss