Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::SegmentFaultHandler Class Reference

Class which intercepts SIGSEGV signals caused in a callback lambda function and recovers from it. Useful in unit testing where a SIGSEGV is expected to happen. More...

#include <SegmentFaultHandler.h>

Public Member Functions

 SegmentFaultHandler (const std::function< void()> &cb)
 Default constructor.
 
 ~SegmentFaultHandler ()
 Destructor cleaning up.
 
 operator bool () const
 When no SIGSEGV was triggered it returns true.
 

Detailed Description

Class which intercepts SIGSEGV signals caused in a callback lambda function and recovers from it. Useful in unit testing where a SIGSEGV is expected to happen.

Constructor & Destructor Documentation

◆ SegmentFaultHandler()

sf::SegmentFaultHandler::SegmentFaultHandler ( const std::function< void()> &  cb)
explicit

Default constructor.

Parameters
cbCallback function.

◆ ~SegmentFaultHandler()

sf::SegmentFaultHandler::~SegmentFaultHandler ( )

Destructor cleaning up.

Member Function Documentation

◆ operator bool()

sf::SegmentFaultHandler::operator bool ( ) const
explicit

When no SIGSEGV was triggered it returns true.


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