Fermat
exceptions.h
1 /*
2  * CUGAR : Cuda Graphics Accelerator
3  *
4  * Copyright (c) 2011-2018, NVIDIA CORPORATION. All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are met:
8  * * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  * notice, this list of conditions and the following disclaimer in the
12  * documentation and/or other materials provided with the distribution.
13  * * Neither the name of the NVIDIA CORPORATION nor the
14  * names of its contributors may be used to endorse or promote products
15  * derived from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20  * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY
21  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27  */
28 
34 #pragma once
35 
36 #include <cugar/basic/types.h>
37 
38 namespace cugar
39 {
40 
43 
44 struct CUGAR_API cuda_error
45 {
46  cuda_error(const char* format, ...);
47 
48  const char* what() const { return s_error; }
49 
50 private:
51  static char s_error[4096];
52 };
53 
54 struct CUGAR_API bad_alloc
55 {
56  bad_alloc(const char* format, ...);
57 
58  const char* what() const { return s_error; }
59 
60 private:
61  static char s_error[4096];
62 };
63 struct CUGAR_API runtime_error
64 {
65  runtime_error(const char* format, ...);
66 
67  const char* what() const { return s_error; }
68 
69 private:
70  static char s_error[4096];
71 };
72 struct CUGAR_API logic_error
73 {
74  logic_error(const char* format, ...);
75 
76  const char* what() const { return s_error; }
77 
78 private:
79  static char s_error[4096];
80 };
81 
83 
84 } // namespace cugar
Definition: exceptions.h:72
Definition: exceptions.h:63
Definition: exceptions.h:54
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
Definition: exceptions.h:44