Exception.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5*
6* ArmarX is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License version 2 as
8* published by the Free Software Foundation.
9*
10* ArmarX is distributed in the hope that it will be useful, but
11* WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18* @package ArmarXCore::Statechart
19* @author Mirko Waechter( mirko.waechter at kit dot edu)
20* @date 2012
21* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22* GNU General Public License
23*/
24#pragma once
25
27
29{
30 struct eStatechartLogicError : LocalException
31 {
32
33 eStatechartLogicError(std::string logicError) :
34 LocalException("The statechart contains a logic error: " + logicError)
35 {
36 }
37
38 ~eStatechartLogicError() noexcept override
39 {
40 }
41
42 std::string
43 name() const override
44 {
45 return "armarx::exceptions::local::eLogicError";
46 }
47 };
48
49 struct eNullPointerException : LocalException
50 {
51
52 eNullPointerException() : LocalException("An accessed pointer is NULL!")
53 {
54 }
55
56 eNullPointerException(std::string hint) :
57 LocalException("An accessed pointer is NULL!" + (!hint.empty() ? " Hint: " + hint : ""))
58 {
59 }
60
61 ~eNullPointerException() noexcept override
62 {
63 }
64
65 std::string
66 name() const override
67 {
68 return "armarx::exceptions::local::eNullPointerException";
69 }
70 };
71
72 struct eNotInitialized : LocalException
73 {
74 eNotInitialized() : LocalException()
75 {
76 }
77
78 std::string
79 name() const override
80 {
81 return "armarx::exceptions::local::eNotInitialized";
82 }
83 };
84
85 struct eStateAlreadyLeft : LocalException
86 {
87 eStateAlreadyLeft() : LocalException("The state was already left!")
88 {
89 }
90
91 std::string
92 name() const override
93 {
94 return "armarx::exceptions::local::eStateAlreadyLeft";
95 }
96 };
97
98 struct eUnknownParameter : LocalException
99 {
100 eUnknownParameter(const std::string& stateName,
101 const std::string& paramName,
102 const std::string hint = "") :
103 LocalException("The state parameter is unknown at this point! State: " + stateName +
104 " parameter: " + paramName + "\n" + hint)
105 {
106 }
107
108 std::string
109 name() const override
110 {
111 return "armarx::exceptions::local::eUnknownParameter";
112 }
113 };
114} // namespace armarx::exceptions::local
std::string name() const override
Definition Exception.h:79
std::string name() const override
Definition Exception.h:92
std::string name() const override
Definition Exception.h:109
eUnknownParameter(const std::string &stateName, const std::string &paramName, const std::string hint="")
Definition Exception.h:100