OTest2
A C++ testing framework
exccatcherordinary.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Ondrej Starek
3  *
4  * This file is part of OTest2.
5  *
6  * OTest2 is free software: you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation, either version 3 of the License,
9  * or (at your option) any later version.
10  *
11  * OTest2 is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14  * License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with OTest2. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OTest2__INCLUDE_OTEST2_EXCCATCHERORDINARY_H_
21 #define OTest2__INCLUDE_OTEST2_EXCCATCHERORDINARY_H_
22 
23 #include <otest2/exccatcher.h>
24 
25 namespace OTest2 {
26 
31  public:
36 
40  virtual ~ExcCatcherOrdinary();
41 
42  /* -- avoid copying */
44  const ExcCatcherOrdinary&) = delete;
46  const ExcCatcherOrdinary&) = delete;
47 
48  virtual bool catchException(
49  const Context& context_,
50  std::function<void(const Context&)> ftor_,
51  std::string& message_) noexcept;
52 };
53 
54 } /* namespace OTest2 */
55 
56 #endif /* OTest2__INCLUDE_OTEST2_EXCCATCHERORDINARY_H_ */
OTest2::ExcCatcherOrdinary::ExcCatcherOrdinary
ExcCatcherOrdinary()
Ctor.
Definition: exccatcherordinary.cpp:30
OTest2::ExcCatcherOrdinary::~ExcCatcherOrdinary
virtual ~ExcCatcherOrdinary()
Dtor.
Definition: exccatcherordinary.cpp:34
OTest2::ExcCatcherOrdinary
Ordinary exception catcher handling std::exception.
Definition: exccatcherordinary.h:30
OTest2::ExcCatcherOrdinary::operator=
ExcCatcherOrdinary & operator=(const ExcCatcherOrdinary &)=delete
OTest2
Definition: assertbean.h:25
exccatcher.h
OTest2::ExcCatcher
Generic exception catcher interface.
Definition: exccatcher.h:39
OTest2::Context
OTest2 runtime context.
Definition: context.h:38
OTest2::ExcCatcherOrdinary::catchException
virtual bool catchException(const Context &context_, std::function< void(const Context &)> ftor_, std::string &message_) noexcept
Catch unexpected exceptions.
Definition: exccatcherordinary.cpp:38