exception.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Intel Corporation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MOVIDIUS_NCS_LIB_EXCEPTION_H
18 #define MOVIDIUS_NCS_LIB_EXCEPTION_H
19 
20 #include <exception>
21 #include <string>
22 
23 namespace movidius_ncs_lib
24 {
25 struct NCSException: public std::exception {};
26 
28 {
29  explicit MvncException(const std::string& msg)
30  : msg_(msg)
31  {
32  }
33 
34  const char* what() const noexcept
35  {
36  return msg_.c_str();
37  }
38 
39 private:
40  const std::string msg_;
41 };
42 
43 struct MvncBusy: public MvncException
44 {
45  explicit MvncBusy(const std::string& msg)
46  : MvncException(msg)
47  {
48  }
49 };
50 
51 struct MvncError: public MvncException
52 {
53  explicit MvncError(const std::string& msg)
54  : MvncException(msg)
55  {
56  }
57 };
58 
60 {
61  explicit MvncOutOfMemory(const std::string& msg)
62  : MvncException(msg)
63  {
64  }
65 };
66 
68 {
69  explicit MvncDeviceNotFound(const std::string& msg)
70  : MvncException(msg)
71  {
72  }
73 };
74 
76 {
77  explicit MvncInvalidParameters(const std::string& msg)
78  : MvncException(msg)
79  {
80  }
81 };
82 
83 struct MvncTimeout: public MvncException
84 {
85  explicit MvncTimeout(const std::string& msg)
86  : MvncException(msg)
87  {
88  }
89 };
90 
92 {
93  explicit MvncMvCmdNotFound(const std::string& msg)
94  : MvncException(msg)
95  {
96  }
97 };
98 
99 struct MvncNoData: public MvncException
100 {
101  explicit MvncNoData(const std::string& msg)
102  : MvncException(msg)
103  {
104  }
105 };
106 
107 struct MvncGone: public MvncException
108 {
109  explicit MvncGone(const std::string& msg)
110  : MvncException(msg)
111  {
112  }
113 };
114 
116 {
117  explicit MvncUnsupportedGraphFile(const std::string& msg)
118  : MvncException(msg)
119  {
120  }
121 };
122 
124 {
125  explicit MvncMyriadError(const std::string& msg)
126  : MvncException(msg)
127  {
128  }
129 };
130 
132 {
133  virtual const char* what() const noexcept = 0;
134 };
135 
137 {
138  const char* what() const noexcept;
139 };
140 
142 {
143  const char* what() const noexcept;
144 };
145 
147 {
148  virtual const char* what() const noexcept = 0;
149 };
150 
152 {
153  const char* what() const noexcept;
154 };
155 
157 {
158  const char* what() const noexcept;
159 };
160 
162 {
163  const char* what() const noexcept;
164 };
165 
167 {
168  const char* what() const noexcept;
169 };
170 
172 {
173  const char* what() const noexcept;
174 };
175 } // namespace movidius_ncs_lib
176 #endif // MOVIDIUS_NCS_LIB_EXCEPTION_H
MvncDeviceNotFound(const std::string &msg)
Definition: exception.h:69
MvncException(const std::string &msg)
Definition: exception.h:29
MvncGone(const std::string &msg)
Definition: exception.h:109
MvncMvCmdNotFound(const std::string &msg)
Definition: exception.h:93
const char * what() const noexcept
Definition: exception.h:34
MvncBusy(const std::string &msg)
Definition: exception.h:45
MvncMyriadError(const std::string &msg)
Definition: exception.h:125
MvncTimeout(const std::string &msg)
Definition: exception.h:85
MvncInvalidParameters(const std::string &msg)
Definition: exception.h:77
MvncError(const std::string &msg)
Definition: exception.h:53
const std::string msg_
Definition: exception.h:40
MvncOutOfMemory(const std::string &msg)
Definition: exception.h:61
MvncNoData(const std::string &msg)
Definition: exception.h:101
MvncUnsupportedGraphFile(const std::string &msg)
Definition: exception.h:117


movidius_ncs_lib
Author(s): Xiaojun Huang
autogenerated on Mon Jun 10 2019 14:11:23