Main MRPT website > C++ reference for MRPT 1.5.6
CHypothesisNotFoundException.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #include "graphs-precomp.h" // Precompiled headers
11 
13 
14 std::ostringstream HypothesisNotFoundException::m_cnvt;
15 
19  runtime_error("Hypothesis between set of nodes was not found")
20 {
21  using namespace mrpt;
22 
23  this->clear();
24  m_to = to;
25  m_from = from;
26 
27  // TODO - Do not allocate it on the stack
28  // http://stackoverflow.com/a/23742555/2843583
29  m_msg = std::runtime_error::what();
30  m_msg += "- ";
31  m_msg += format("[from] %lu ==> ", static_cast<unsigned long>(m_from)).c_str();
32  m_msg += format("[to] %lu", static_cast<unsigned long>(m_to)).c_str();
33 }
34 
36  runtime_error("Hypothesis with the given ID was not found")
37 {
38  using namespace mrpt;
39 
40  this->clear();
41  m_id = id;
42 
43  m_msg = std::runtime_error::what();
44  m_msg += format("- ID:%lu", static_cast<unsigned long>(id)).c_str();
45 }
46 
50  m_id = SIZE_MAX;
51  m_msg.clear();
52 }
53 
55 
57  return m_msg;
58 }
59 
60 const char* HypothesisNotFoundException::what() const throw() {
61  m_cnvt.str("");
62  m_cnvt << getErrorMsg();
63  return m_cnvt.str().c_str();
64 }
65 
#define INVALID_NODEID
HypothesisNotFoundException(mrpt::utils::TNodeID from, mrpt::utils::TNodeID to)
GLuint id
Definition: glew.h:1584
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: glew.h:1168
uint64_t TNodeID
The type for node IDs in graphs of different types.
Definition: types_simple.h:45
GLsizei const GLcharARB ** string
Definition: glew.h:3293



Page generated by Doxygen 1.8.6 for MRPT 1.5.6 Git: 4c65e84 Tue Apr 24 08:18:17 2018 +0200 at mar abr 24 08:26:17 CEST 2018