OTest2
A C++ testing framework
Public Member Functions | List of all members
OTest2::ExcCatcher Class Referenceabstract

Generic exception catcher interface. More...

#include <exccatcher.h>

Inheritance diagram for OTest2::ExcCatcher:
Inheritance graph
[legend]

Public Member Functions

 ExcCatcher ()
 Ctor. More...
 
virtual ~ExcCatcher ()
 Dtor. More...
 
 ExcCatcher (const ExcCatcher &)=delete
 
ExcCatcheroperator= (const ExcCatcher &)=delete
 
virtual bool catchException (const Context &context_, std::function< void(const Context &)> ftor_, std::string &message_) noexcept=0
 Catch unexpected exceptions. More...
 

Detailed Description

Generic exception catcher interface.

This interface allows to catch exceptions raised inside a code functional. It's used to catch and report unexpected exceptions inside user code or inside exception assertions. Real catcher implementation is set in the OTest2 context. User of the framework can make own implementation to adjust the framework for its environment.

Definition at line 39 of file exccatcher.h.

Constructor & Destructor Documentation

◆ ExcCatcher() [1/2]

OTest2::ExcCatcher::ExcCatcher ( )

Ctor.

Definition at line 24 of file exccatcher.cpp.

◆ ~ExcCatcher()

OTest2::ExcCatcher::~ExcCatcher ( )
virtual

Dtor.

Definition at line 28 of file exccatcher.cpp.

◆ ExcCatcher() [2/2]

OTest2::ExcCatcher::ExcCatcher ( const ExcCatcher )
delete

Member Function Documentation

◆ catchException()

virtual bool OTest2::ExcCatcher::catchException ( const Context context_,
std::function< void(const Context &)>  ftor_,
std::string &  message_ 
)
pure virtualnoexcept

Catch unexpected exceptions.

Parameters
[in]context_The OTest2 context
[in]ftor_the functional which the exceptions can occurs in.
[out]message_If an exception happens an error message is filled in.
Returns
True if an exception happens. False otherwise.

Implemented in OTest2::ExcCatcherOrdinary.

◆ operator=()

ExcCatcher& OTest2::ExcCatcher::operator= ( const ExcCatcher )
delete

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