This "utility" class maintains a pointer containing the address of the current assertion‐failure handler function (of type Assert::ViolationHandler) and provides methods to administer this function pointer. The invokeHandler method calls the currently‐installed failure handler. This class also provides a suite of standard failure‐handler functions that are suitable to be installed as the current Assert::ViolationHandler function. Note that clients are free to install any of these ("off‐the‐shelf") handlers, or to provide their own ("custom") assertion‐failure handler functions when using this facility. Also note that assertion‐failure handler functions must not return (i.e., they must abort, exit, terminate, throw, or hang).
Synopsis
Declared in <bsls_assert.h>
class Assert;
Description
Finally, this class defines the constant strings that are passed as the reviewLevel to the bsls_review handler for checks that failed in "review mode" (see {Assertion Modes}).
Type Aliases
Name |
Description |
|
|
|
Static Member Functions
Name |
Description |
Return |
|
|
DEPRECATED: Use |
|
(Default Handler) Emulate the invocation of the standard |
|
Use the expression |
|
Throw an |
|
DEPRECATED: Use |
|
DEPRECATED: Use |
Return the address of the currently installed assertion‐failure handler function if it is a |
|
|
|
|
Invoke the currently installed assertion‐failure handler function with the specified |
Disable all subsequent calls to |
|
DO NOT USE! It is a violation of Bloomberg policy to invoke this function without having prior authorization from senior management. |
|
Make the specified handler |
|
Make the specified violation handler |
|
Return the address of the currently installed assertion‐failure handler function. |
Static Data Members
Name |
Description |
String identifier ("DBG") for |
|
String identifier ("INV") for |
|
String identifier ("OPT") for |
|
String identifier ("SAF") for |
|
Build key used to enforce assertion handler return policy; has value "No". See {Assertion Handler Policy}. |
Friends
Name |
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 ( |
Created with MrDocs