Scope Exit Architecture#

Scope Exit Architecture
status: draft
security: YES
safety: ASIL_B
bazel_module: score_baselibs
version: 2
Scope Exit
status: valid
security: YES
safety: ASIL_B

The Scope Exit component contains RAII scope guards that invoke a callable on scope exit unless released.

Scope Exit Static view
status: valid
security: YES
safety: ASIL_B

Interfaces#

Constructor
status: valid
security: YES
safety: ASIL_B
tags: baselibs, scope_exit
bazel_module: score_baselibs
version: 1

Creates an active scope guard that owns the supplied callback.

Destructor
status: valid
security: YES
safety: ASIL_B
tags: baselibs, scope_exit
bazel_module: score_baselibs
version: 1

Invokes the callback once when the active scope guard is destroyed.

Release
status: valid
security: YES
safety: ASIL_B
tags: baselibs, scope_exit
bazel_module: score_baselibs
version: 1

Deactivates the scope guard so destruction does not invoke its callback.

Transfer Callback Ownership
status: valid
security: YES
safety: ASIL_B
tags: baselibs, scope_exit
bazel_module: score_baselibs
version: 1

Transfers callback ownership during move construction or move assignment.