AlexaClientSDK  1.26.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
Public Member Functions | List of all members
alexaClientSDK::acsdkPkcs11::ErrorCleanupGuard Class Reference

Error cleanup function on error. More...

#include <ErrorCleanupGuard.h>

Inheritance diagram for alexaClientSDK::acsdkPkcs11::ErrorCleanupGuard:
Inheritance graph
[legend]
Collaboration diagram for alexaClientSDK::acsdkPkcs11::ErrorCleanupGuard:
Collaboration graph
[legend]

Public Member Functions

 ErrorCleanupGuard (bool &successFlag, std::function< void()> &&cleanupFunction) noexcept
 Prepares lambda for execution. More...
 
- Public Member Functions inherited from alexaClientSDK::avsCommon::utils::error::FinallyGuard
 FinallyGuard (const std::function< void()> &finallyFunction)
 
 ~FinallyGuard ()
 

Detailed Description

Error cleanup function on error.

This object executes lambda on destruction only if success variable is false.

See also
alexaClientSDK::avsCommon::utils::error::FinallyGuard

Constructor & Destructor Documentation

◆ ErrorCleanupGuard()

alexaClientSDK::acsdkPkcs11::ErrorCleanupGuard::ErrorCleanupGuard ( bool &  successFlag,
std::function< void()> &&  cleanupFunction 
)
inlinenoexcept

Prepares lambda for execution.

This method constructs FinallyGuard that will trigger successFlag check and optional cleanupFunction execution on destruction.

Parameters
[in]successFlagFlag to check if cleanupFunction needs to be executed.
[in]cleanupFunctionFunction reference to execute if successFlag is false.

The documentation for this class was generated from the following file:

AlexaClientSDK 1.26.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0