iRoCS Toolbox  1.1.0
BlitzFFTWError.hh
Go to the documentation of this file.
1 /**************************************************************************
2  *
3  * Copyright (C) 2010 Thorsten Falk, Mario Emmenlauer
4  *
5  * Image Analysis Lab, University of Freiburg, Germany
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software Foundation,
19  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  **************************************************************************/
22 
23 /**************************************************************************
24 ** Title:
25 ** $RCSfile$
26 ** $Revision: 1384 $$Name$
27 ** $Date: 2007-11-28 14:02:45 +0100 (Wed, 28 Nov 2007) $
28 ** Copyright: GPL $Author: fehr $
29 ** Description:
30 **
31 **
32 **
33 **-------------------------------------------------------------------------
34 **
35 ** $Log$
36 ** Revision 1.1 2007/11/28 13:02:45 fehr
37 ** Error class added, bugfix: shape=0 -> is_continous=false
38 **
39 **
40 **
41 **************************************************************************/
42 
43 #ifndef BLITZFFTWERROR_HH
44 #define BLITZFFTWERROR_HH
45 
46 #ifdef HAVE_CONFIG_H
47 #include <config.hh>
48 #endif
49 
50 #include <string>
51 #include <sstream>
52 #include <iostream>
53 #include <exception>
54 
55 #ifdef _WIN32
56  #if defined(BlitzFFTW_EXPORTS)
57  #define BLITZFFTWDLL_API __declspec(dllexport)
58  #elif defined(BlitzFFTW_USE_DLL)
59  #define BLITZFFTWDLL_API __declspec(dllimport)
60  #else
61  #define BLITZFFTWDLL_API
62  #endif
63 #else
64  #define BLITZFFTWDLL_API
65 #endif
66 
67 class BLITZFFTWDLL_API BlitzFFTWError : public std::exception
68 {
69 public:
70  BlitzFFTWError() throw()
71  {}
72 
73  BlitzFFTWError( const std::string& message) throw()
74  :_message( message)
75  {}
76 
77  virtual ~BlitzFFTWError() throw()
78  {}
79 
80  template<class DataType>
81  BlitzFFTWError & operator<<( const DataType &data) throw()
82  {
83  std::ostringstream os;
84  os << data;
85  _message += os.str();
86  return *this;
87  }
88 
89  std::string str() const throw()
90  {
91  return _message;
92  }
93 
94  const char* what() const throw()
95  {
96  return _message.c_str();
97  }
98 
99 
100 private:
101  std::string _message;
102 
103 };
104 
105 #endif
#define BLITZFFTWDLL_API
virtual ~BlitzFFTWError()
std::string str() const
BlitzFFTWError & operator<<(const DataType &data)
BlitzFFTWError(const std::string &message)
const char * what() const