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