GIFT-Grab  1708
Copyright (c) 2015-7, University College London (UCL)
except.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <stdexcept>
4 #include <string>
5 
6 namespace gg {
7 
16 class BasicException : public std::exception {
17 protected:
21  std::string _detail;
22 
23 public:
28  BasicException(const std::string & detail);
29 
33  virtual ~BasicException() noexcept;
34 
39  virtual const char * what() const noexcept override;
40 };
41 
51 {
52 public:
58  DeviceAlreadyConnected(const std::string & detail);
59 
64  virtual ~DeviceAlreadyConnected() noexcept;
65 };
66 
75 public:
81  DeviceNotFound(const std::string & detail);
82 
87  virtual ~DeviceNotFound() noexcept;
88 };
89 
97 class DeviceOffline : public BasicException {
98 public:
104  DeviceOffline(const std::string & detail);
105 
110  virtual ~DeviceOffline() noexcept;
111 };
112 
121 {
122 public:
128  VideoTargetError(const std::string & detail);
129 
134  virtual ~VideoTargetError() noexcept;
135 };
136 
145 {
146 public:
151  VideoSourceError(const std::string & detail);
152 
157  virtual ~VideoSourceError() noexcept;
158 };
159 
168 {
169 public:
174  ObserverError(const std::string & detail);
175 
180  virtual ~ObserverError() noexcept;
181 };
182 
191 {
192 public:
197  NetworkSourceUnavailable(const std::string & detail);
198 
203  virtual ~NetworkSourceUnavailable() noexcept;
204 };
205 
206 }
Thrown if connection attempts by gg::VideoSourceFactory to requested device fail. ...
Definition: except.h:74
virtual ~BasicException() noexcept
Destructor.
Definition: except.cpp:11
std::string _detail
Exception details.
Definition: except.h:21
Thrown in case of errors related to video sources.
Definition: except.h:144
More specific exceptions should extend this class, which provides all basic exception functionality...
Definition: except.h:16
Thrown if a connected device is offline, i.e. not returning any frames.
Definition: except.h:97
Definition: broadcastdaemon.cpp:7
Thrown in case of errors related to connecting video observers to video sources.
Definition: except.h:167
Thrown in case a connection is attempted to a device that is already connected.
Definition: except.h:50
virtual const char * what() const noexcept override
Get exception detail.
Definition: except.cpp:16
Thrown in case of problems outputting video, e.g. to files.
Definition: except.h:120
Thrown in case of problems related to network video sources.
Definition: except.h:190
BasicException(const std::string &detail)
Constructor with detail.
Definition: except.cpp:5