Medical Imaging Interaction Toolkit  2018.4.99-389bf124
Medical Imaging Interaction Toolkit
mitkException.cpp
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #include "mitkException.h"
14 
15 void mitk::Exception::AddRethrowData(const char *file, unsigned int lineNumber, const char *message)
16 {
17  mitk::Exception::ReThrowData data = {file, lineNumber, message};
18  this->m_RethrowData.push_back(data);
19 }
20 
22 {
23  return (int)m_RethrowData.size();
24 }
25 
26 void mitk::Exception::GetRethrowData(int rethrowNumber, std::string &file, int &line, std::string &message)
27 {
28  if ((rethrowNumber >= (int)m_RethrowData.size()) || (rethrowNumber < 0))
29  {
30  file = "";
31  line = 0;
32  message = "";
33  return;
34  }
35 
36  file = m_RethrowData.at(rethrowNumber).RethrowClassname;
37  line = m_RethrowData.at(rethrowNumber).RethrowLine;
38  message = m_RethrowData.at(rethrowNumber).RethrowMessage;
39 }
40 
41 std::ostream &mitk::operator<<(std::ostream &os, const mitk::Exception &e)
42 {
43  os << e.GetDescription();
44  return os;
45 }
static char * line
Definition: svm.cpp:2870
void AddRethrowData(const char *file, unsigned int lineNumber, const char *message)
Adds rethrow data to this exception.
std::vector< ReThrowData > m_RethrowData
void GetRethrowData(int rethrowNumber, std::string &file, int &line, std::string &message)
An object of this class represents an exception of MITK. Please don&#39;t instantiate exceptions manually...
Definition: mitkException.h:45
MITKCORE_EXPORT std::ostream & operator<<(std::ostream &o, DataNode::Pointer &dtn)