Realistic 3D camera system
3D camera system components
system_error.hpp
Go to the documentation of this file.
1 //
2 // system_error.hpp
3 // ~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_SYSTEM_ERROR_HPP
12 #define ASIO_SYSTEM_ERROR_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 
20 #if defined(ASIO_HAS_STD_SYSTEM_ERROR)
21 # include <system_error>
22 #else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
23 # include <cerrno>
24 # include <exception>
25 # include <string>
26 # include "asio/error_code.hpp"
28 #endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
29 
31 
32 namespace asio {
33 
34 #if defined(ASIO_HAS_STD_SYSTEM_ERROR)
35 
36 typedef std::system_error system_error;
37 
38 #else // defined(ASIO_HAS_STD_SYSTEM_ERROR)
39 
42 class system_error
43  : public std::exception
44 {
45 public:
48  : code_(ec),
49  context_()
50  {
51  }
52 
54  system_error(const error_code& ec, const std::string& context)
55  : code_(ec),
56  context_(context)
57  {
58  }
59 
61  system_error(const system_error& other)
62  : std::exception(other),
63  code_(other.code_),
64  context_(other.context_),
65  what_()
66  {
67  }
68 
70  virtual ~system_error() throw ()
71  {
72  }
73 
75  system_error& operator=(const system_error& e)
76  {
77  context_ = e.context_;
78  code_ = e.code_;
79  what_.reset();
80  return *this;
81  }
82 
84  virtual const char* what() const throw ()
85  {
86 #if !defined(ASIO_NO_EXCEPTIONS)
87  try
88 #endif // !defined(ASIO_NO_EXCEPTIONS)
89  {
90  if (!what_.get())
91  {
92  std::string tmp(context_);
93  if (tmp.length())
94  tmp += ": ";
95  tmp += code_.message();
96  what_.reset(new std::string(tmp));
97  }
98  return what_->c_str();
99  }
100 #if !defined(ASIO_NO_EXCEPTIONS)
101  catch (std::exception&)
102  {
103  return "system_error";
104  }
105 #endif // !defined(ASIO_NO_EXCEPTIONS)
106  }
107 
109  error_code code() const
110  {
111  return code_;
112  }
113 
114 private:
115  // The code associated with the error.
116  error_code code_;
117 
118  // The context associated with the error.
119  std::string context_;
120 
121  // The string representation of the error.
123 };
124 
125 #endif // defined(ASIO_HAS_STD_SYSTEM_ERROR)
126 
127 } // namespace asio
128 
130 
131 #endif // ASIO_SYSTEM_ERROR_HPP
virtual const char * what() const
Get a string representation of the exception.
system_error(const error_code &ec, const std::string &context)
Construct with an error code and context.
pylon Camera Software Suite for Linux for Use with Basler Gigabit the pylon Viewer and the IP Configurator applications might not be available System I340 and I350 series Although the pylon software will work with any GigE network we would recommend to use one of these adapters USB For U3V devices a USB3 capable USB controller is necessary For best performance and stability we highly recommend a kernel the following settings should be i e
STL namespace.
system_error(const system_error &other)
Copy constructor.
virtual ~system_error()
Destructor.
Class to represent an error code value.
Definition: error_code.hpp:80
error_code code() const
Get the error code associated with the exception.
system_error(const error_code &ec)
Construct with an error code.
std::string message() const
Get the message associated with the error.
Definition: error_code.hpp:117
system_error & operator=(const system_error &e)
Assignment operator.