libqi  1.14
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
error.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the COPYING file.
5  */
6 
11 #pragma once
12 #ifndef _LIBQI_QI_ERROR_HPP_
13 #define _LIBQI_QI_ERROR_HPP_
14 
15 # include <qi/macro.hpp>
16 # include <qi/config.hpp>
17 
18 # include <stdexcept>
19 # include <string>
20 
21 namespace qi {
22  namespace os {
23 
24 #ifdef _MSC_VER
25 # pragma warning( push )
26 # pragma warning( disable : 4251 )
27 // non dll-interface std::runtime_error used as base for dll-interface calss
28 // qi::os::QiException
29 # pragma warning( disable : 4275 )
30 #endif
31 
36  class QI_API QI_API_DEPRECATED QiException : public std::runtime_error
37  {
38  public:
39 
47  explicit QiException(const std::string &message)
48  : std::runtime_error(message)
49  {}
50 
56  : std::runtime_error(e.what())
57  {}
58 
60  virtual ~QiException() throw()
61  {}
62 
63 #ifdef _MSC_VER
64 # pragma warning( pop )
65 #endif
66  };
67  }
68 }
69 
70 #endif // _LIBQI_QI_ERROR_HPP_