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 {
31  : LocalException
32  {
33 
34  eStatechartLogicError(std::string logicError): LocalException("The statechart contains a logic error: " + logicError) {}
35  ~eStatechartLogicError() noexcept override {}
36  std::string name() const override
37  {
38  return "armarx::exceptions::local::eLogicError";
39  }
40 
41  };
42  struct eNullPointerException : LocalException
43  {
44 
45  eNullPointerException(): LocalException("An accessed pointer is NULL!") {}
46 
47  eNullPointerException(std::string hint): LocalException("An accessed pointer is NULL!" + (!hint.empty() ? " Hint: " + hint : "")) {}
48 
49  ~eNullPointerException() noexcept override {}
50  std::string name() const override
51  {
52  return "armarx::exceptions::local::eNullPointerException";
53  }
54  };
55  struct eNotInitialized : LocalException
56  {
57  eNotInitialized(): LocalException() {}
58  std::string name() const override
59  {
60  return "armarx::exceptions::local::eNotInitialized";
61  }
62  };
63 
64  struct eStateAlreadyLeft : LocalException
65  {
66  eStateAlreadyLeft() : LocalException("The state was already left!") {}
67  std::string name() const override
68  {
69  return "armarx::exceptions::local::eStateAlreadyLeft";
70  }
71 
72  };
73 
74  struct eUnknownParameter : LocalException
75  {
76  eUnknownParameter(const std::string& stateName, const std::string& paramName, const std::string hint = "") : LocalException("The state parameter is unknown at this point! State: " + stateName + " parameter: " + paramName + "\n" + hint) {}
77  std::string name() const override
78  {
79  return "armarx::exceptions::local::eUnknownParameter";
80  }
81 
82  };
83 }
armarx::exceptions::local::eStateAlreadyLeft
Definition: Exception.h:64
armarx::exceptions::local::eStatechartLogicError::~eStatechartLogicError
~eStatechartLogicError() noexcept override
Definition: Exception.h:35
LocalException.h
armarx::exceptions::local::eNotInitialized
Definition: Exception.h:55
armarx::exceptions::local::eNullPointerException::name
std::string name() const override
Definition: Exception.h:50
armarx::exceptions::local::eStatechartLogicError::eStatechartLogicError
eStatechartLogicError(std::string logicError)
Definition: Exception.h:34
armarx::exceptions::local::eUnknownParameter
Definition: Exception.h:74
armarx::exceptions::local::eUnknownParameter::eUnknownParameter
eUnknownParameter(const std::string &stateName, const std::string &paramName, const std::string hint="")
Definition: Exception.h:76
armarx::exceptions::local::eNotInitialized::eNotInitialized
eNotInitialized()
Definition: Exception.h:57
armarx::exceptions::local::eNullPointerException
Definition: Exception.h:42
armarx::exceptions::local::eNullPointerException::eNullPointerException
eNullPointerException()
Definition: Exception.h:45
armarx::exceptions::local::eStatechartLogicError
Definition: Exception.h:30
cxxopts::empty
bool empty(const std::string &s)
Definition: cxxopts.hpp:255
armarx::exceptions::local
Definition: DynamicLibraryException.h:31
armarx::exceptions::local::eStateAlreadyLeft::eStateAlreadyLeft
eStateAlreadyLeft()
Definition: Exception.h:66
armarx::exceptions::local::eStateAlreadyLeft::name
std::string name() const override
Definition: Exception.h:67
armarx::exceptions::local::eNullPointerException::~eNullPointerException
~eNullPointerException() noexcept override
Definition: Exception.h:49
armarx::exceptions::local::eUnknownParameter::name
std::string name() const override
Definition: Exception.h:77
armarx::exceptions::local::eNotInitialized::name
std::string name() const override
Definition: Exception.h:58
armarx::exceptions::local::eStatechartLogicError::name
std::string name() const override
Definition: Exception.h:36
armarx::exceptions::local::eNullPointerException::eNullPointerException
eNullPointerException(std::string hint)
Definition: Exception.h:47