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
27#include <string>
28
30
32{
33 class InvalidDataFieldException : public armarx::LocalException
34 {
35 public:
36 std::string channelName;
37 std::string datafieldName;
38
41 {
42 std::stringstream sstream;
43 sstream << "The dataField " << datafieldName << " is not valid for channel "
44 << channelName << ".";
45 setReason(sstream.str());
46 }
47
48 ~InvalidDataFieldException() noexcept override
49 {
50 }
51
52 std::string
53 name() const override
54 {
55 return "armarx::exceptions::local::InvalidDataFieldException";
56 }
57 };
58
59 class IncompleteTypeException : public armarx::LocalException
60 {
61 public:
62 int typeId;
63 std::string foundType;
64
65 IncompleteTypeException(int typeId, const std::string& foundTypeStr) :
66 typeId(typeId), foundType(foundTypeStr)
67 {
68 std::stringstream sstream;
69 sstream << "Found an incomplete type with id " << typeId
70 << " - found the following type: " << foundType;
71 setReason(sstream.str());
72 }
73
74 ~IncompleteTypeException() noexcept override
75 {
76 }
77
78 std::string
79 name() const override
80 {
81 return "armarx::exceptions::local::IncompleteTypeException";
82 }
83 };
84} // namespace armarx::exceptions::local
IncompleteTypeException(int typeId, const std::string &foundTypeStr)
InvalidDataFieldException(std::string channelName, std::string datafieldName)