exceptions.cpp
Go to the documentation of this file.
1
#include "
exceptions.h
"
2
3
namespace
armarx::trajectory::error
4
{
5
TrajectoryException::TrajectoryException
(
const
std::string& msg) :
std
::logic_error(msg)
6
{
7
}
8
9
InterpolateDifferentTypesError::InterpolateDifferentTypesError
() :
10
TrajectoryException
(
"Interpolating between two different types."
)
11
{
12
}
13
14
NoTrackWithID::NoTrackWithID
(
const
TrackID
&
id
) :
TrajectoryException
(makeMsg(id))
15
{
16
}
17
18
std::string
19
NoTrackWithID::makeMsg
(
const
TrackID
&
id
)
20
{
21
std::stringstream ss;
22
ss <<
"No track with ID '"
<<
id
<<
"'. \n"
23
<<
"Add a track with ID '"
<<
id
<<
"' before before adding keyframes."
;
24
return
ss.str();
25
}
26
27
EmptyTrack::EmptyTrack
(
const
TrackID
&
id
) :
TrajectoryException
(makeMsg(id))
28
{
29
}
30
31
std::string
32
EmptyTrack::makeMsg
(
const
TrackID
&
id
)
33
{
34
std::stringstream ss;
35
ss <<
"Track with ID '"
<<
id
36
<<
"' is empty. \n"
37
"Add a keyframe to track '"
38
<<
id
<<
"' before updating."
;
39
return
ss.str();
40
}
41
42
static
std::string
43
makeMsg(
const
TrackID
&
id
,
int
typeIndex,
int
expectedTypeIndex)
44
{
45
std::stringstream ss;
46
ss <<
"Tried to add keyframe with value type '"
<< typeIndex <<
"' to non-empty track '"
47
<<
id
<<
"' containing values of type '"
<< expectedTypeIndex <<
"'. \n"
48
<<
"Only one value type per track is allowed."
;
49
return
ss.str();
50
}
51
52
WrongValueTypeInKeyframe::WrongValueTypeInKeyframe
(
const
TrackID
& trackID,
53
int
typeIndex,
54
int
expectedTypeIndex) :
55
TrajectoryException
(makeMsg(trackID, typeIndex, expectedTypeIndex))
56
{
57
}
58
59
60
}
// namespace armarx::trajectory::error
armarx::trajectory::error::EmptyTrack::makeMsg
static std::string makeMsg(const TrackID &id)
Definition:
exceptions.cpp:32
armarx::trajectory::TrackID
std::string TrackID
ID of tracks.
Definition:
VariantValue.h:15
armarx::trajectory::error::TrajectoryException::TrajectoryException
TrajectoryException(const std::string &msg)
Definition:
exceptions.cpp:5
armarx::trajectory::error::NoTrackWithID::makeMsg
static std::string makeMsg(const TrackID &id)
Definition:
exceptions.cpp:19
armarx::trajectory::error::InterpolateDifferentTypesError::InterpolateDifferentTypesError
InterpolateDifferentTypesError()
Definition:
exceptions.cpp:9
armarx::trajectory::error::EmptyTrack::EmptyTrack
EmptyTrack(const TrackID &id)
Definition:
exceptions.cpp:27
armarx::trajectory::error::TrajectoryException
Definition:
exceptions.h:12
std
Definition:
Application.h:66
exceptions.h
armarx::trajectory::error::NoTrackWithID::NoTrackWithID
NoTrackWithID(const TrackID &id)
Definition:
exceptions.cpp:14
armarx::trajectory::error
Definition:
exceptions.cpp:3
armarx::trajectory::error::WrongValueTypeInKeyframe::WrongValueTypeInKeyframe
WrongValueTypeInKeyframe(const TrackID &trackID, int typeIndex, int expectedTypeIndex)
Definition:
exceptions.cpp:52
RobotAPI
libraries
SimpleTrajectory
exceptions.cpp
Generated on Sat Mar 29 2025 09:17:25 for armarx_documentation by
1.8.17