BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsls::AssertFailureHandlerGuard Class Reference

#include <bsls_assert.h>

Public Member Functions

 AssertFailureHandlerGuard (Assert::ViolationHandler temporary)
 
 AssertFailureHandlerGuard (Assert::Handler temporary)
 
 ~AssertFailureHandlerGuard ()
 

Detailed Description

An object of this class saves the current assert handler and installs the one specified on construction. On destruction, the original assert handler is restored. Note that two objects of this class cannot be safely used concurrently from two separate threads (but may of course appear sequentially, including in nested blocks and function invocations within a single thread). Note that the behavior of objects of this class is unaffected by the (static) Assert::lockAssertAdministration method (i.e., the temporary replacement will occur, regardless of whether that method has been invoked.)

See bsls_assert

Constructor & Destructor Documentation

◆ AssertFailureHandlerGuard() [1/2]

bsls::AssertFailureHandlerGuard::AssertFailureHandlerGuard ( Assert::ViolationHandler  temporary)
explicit

◆ AssertFailureHandlerGuard() [2/2]

bsls::AssertFailureHandlerGuard::AssertFailureHandlerGuard ( Assert::Handler  temporary)
explicit

Create a guard object that installs the specified temporary failure handler and automatically restores the original handler on destruction.

◆ ~AssertFailureHandlerGuard()

bsls::AssertFailureHandlerGuard::~AssertFailureHandlerGuard ( )

Restore the failure handler that was in place when this object was created and destroy this guard.


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