Stride Reference Manual  - generated for commit 9643b11
Exception.h
Go to the documentation of this file.
1 /*
2  * This is free software: you can redistribute it and/or modify it
3  * under the terms of the GNU General Public License as published by
4  * the Free Software Foundation, either version 3 of the License, or
5  * any later version.
6  * The software is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  * You should have received a copy of the GNU General Public License
11  * along with the software. If not, see <http://www.gnu.org/licenses/>.
12  *
13  * Copyright 2018, Jan Broeckhove and Bistromatics group.
14  */
15 
16 #pragma once
17 
18 #include <stdexcept>
19 #include <string>
20 
21 namespace stride {
22 namespace util {
23 
28 class Exception : public std::exception
29 {
30 public:
32  explicit Exception(std::string msg) : m_msg(std::move(msg)) {}
33 
35  const char* what() const noexcept override { return m_msg.c_str(); }
36 
38  ~Exception() noexcept override = default;
39 
40 private:
41  std::string m_msg;
42 };
43 
44 } // namespace util
45 } // namespace stride
Exception(std::string msg)
Straightforward constructor.
Definition: Exception.h:32
const char * what() const noexceptoverride
Return the message.
Definition: Exception.h:35
STL namespace.
Basic exception class: needed to prevent clang-tidy warning "thrown exception type is not nothrow cop...
Definition: Exception.h:28
~Exception() noexceptoverride=default
Default constructor.
Namespace for the simulator and related classes.
Definition: Calendar.cpp:28