InvalidDataFieldException.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 ArmarX::Tools
19 * @author Kai Welke
20 * @date 2011 Humanoids Group, HIS, KIT
21 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22 * GNU General Public License
23 */
24 
25 #pragma once
26 
28 
29 #include <string>
30 
32 {
33  class InvalidDataFieldException: public armarx::LocalException
34  {
35  public:
36  std::string channelName;
37  std::string datafieldName;
38 
42  {
43  std::stringstream sstream;
44  sstream << "The dataField " << datafieldName << " is not valid for channel " << channelName << ".";
45  setReason(sstream.str());
46  }
47 
48  ~InvalidDataFieldException() noexcept override { }
49 
50  std::string name() const override
51  {
52  return "armarx::exceptions::local::InvalidDataFieldException";
53  }
54  };
55 
56  class IncompleteTypeException: public armarx::LocalException
57  {
58  public:
59  int typeId;
60  std::string foundType;
61 
62  IncompleteTypeException(int typeId, const std::string& foundTypeStr):
63  typeId(typeId),
64  foundType(foundTypeStr)
65  {
66  std::stringstream sstream;
67  sstream << "Found an incomplete type with id " << typeId << " - found the following type: " << foundType;
68  setReason(sstream.str());
69  }
70 
71  ~IncompleteTypeException() noexcept override { }
72 
73  std::string name() const override
74  {
75  return "armarx::exceptions::local::IncompleteTypeException";
76  }
77  };
78 }
armarx::exceptions::local::InvalidDataFieldException::InvalidDataFieldException
InvalidDataFieldException(std::string channelName, std::string datafieldName)
Definition: InvalidDataFieldException.h:39
armarx::exceptions::local::InvalidDataFieldException::name
std::string name() const override
Definition: InvalidDataFieldException.h:50
armarx::exceptions::local::InvalidDataFieldException::datafieldName
std::string datafieldName
Definition: InvalidDataFieldException.h:37
armarx::exceptions::local::InvalidDataFieldException::~InvalidDataFieldException
~InvalidDataFieldException() noexcept override
Definition: InvalidDataFieldException.h:48
armarx::exceptions::local::IncompleteTypeException::name
std::string name() const override
Definition: InvalidDataFieldException.h:73
armarx::exceptions::local
Definition: DynamicLibraryException.h:31
armarx::exceptions::local::InvalidDataFieldException
Definition: InvalidDataFieldException.h:33
armarx::exceptions::local::IncompleteTypeException::typeId
int typeId
Definition: InvalidDataFieldException.h:59
armarx::exceptions::local::IncompleteTypeException::~IncompleteTypeException
~IncompleteTypeException() noexcept override
Definition: InvalidDataFieldException.h:71
armarx::exceptions::local::IncompleteTypeException::foundType
std::string foundType
Definition: InvalidDataFieldException.h:60
armarx::exceptions::local::IncompleteTypeException::IncompleteTypeException
IncompleteTypeException(int typeId, const std::string &foundTypeStr)
Definition: InvalidDataFieldException.h:62
armarx::exceptions::local::InvalidDataFieldException::channelName
std::string channelName
Definition: InvalidDataFieldException.h:36
armarx::exceptions::local::IncompleteTypeException
Definition: InvalidDataFieldException.h:56
Exception.h