libqi-api  2.1.4.13
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
error.hpp
Go to the documentation of this file.
1 #pragma once
2 /*
3  * Copyright (c) 2012 Aldebaran Robotics. All rights reserved.
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the COPYING file.
6  */
7 
12 #ifndef _QI_ERROR_HPP_
13 #define _QI_ERROR_HPP_
14 
15 # include <qi/api.hpp>
16 
17 # include <stdexcept>
18 # include <string>
19 
20 namespace qi {
21  namespace os {
22 
23 #ifdef _MSC_VER
24 # pragma warning( push )
25 # pragma warning( disable : 4251 )
26 // non dll-interface std::runtime_error used as base for dll-interface calss
27 // qi::os::QiException
28 # pragma warning( disable : 4275 )
29 #endif
30 
35  class QI_API QI_API_DEPRECATED QiException : public std::runtime_error
36  {
37  public:
38 
46  explicit QiException(const std::string &message)
47  : std::runtime_error(message)
48  {}
49 
55  : std::runtime_error(e.what())
56  {}
57 
59  virtual ~QiException() throw()
60  {}
61 
62 #ifdef _MSC_VER
63 # pragma warning( pop )
64 #endif
65  };
66  }
67 }
68 
69 #endif // _QI_ERROR_HPP_
QiException(const std::string &message)
Constructor.
Definition: error.hpp:46
Custom exception that may be thrown by QI methods.
Definition: error.hpp:35
virtual ~QiException()
Destructor.
Definition: error.hpp:59
QiException(const QiException &e)
Copy constructor.
Definition: error.hpp:54
#define QI_API_DEPRECATED
Compiler flags to mark a function as deprecated. It will generate a compiler warning.
Definition: macro.hpp:25
dll import/export and compiler message
#define QI_API
Definition: api.hpp:24