/[escript]/trunk/cusplibrary/cusp/exception.h
ViewVC logotype

Contents of /trunk/cusplibrary/cusp/exception.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5148 - (show annotations)
Mon Sep 15 01:25:23 2014 UTC (5 years, 8 months ago) by caltinay
File MIME type: text/plain
File size: 2476 byte(s)
Merging ripley diagonal storage + CUDA support into trunk.
Options file version has been incremented due to new options
'cuda' and 'nvccflags'.

1 /*
2 * Copyright 2008-2009 NVIDIA 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 /*! \file exception.h
18 * \brief Cusp exceptions
19 */
20
21 #pragma once
22
23 #include <cusp/detail/config.h>
24
25 #include <string>
26 #include <stdexcept>
27
28 namespace cusp
29 {
30
31 class exception : public std::exception
32 {
33 public:
34 exception(const exception& exception_) : message(exception_.message) {}
35 exception(const std::string& message_) : message(message_) {}
36 ~exception() throw() {}
37 const char* what() const throw() { return message.c_str(); }
38
39 protected:
40 std::string message;
41 };
42
43 class not_implemented_exception : public exception
44 {
45 public:
46 template <typename MessageType>
47 not_implemented_exception(const MessageType& message) : exception(message) {}
48 };
49
50 class io_exception : public exception
51 {
52 public:
53 template <typename MessageType>
54 io_exception(const MessageType& message) : exception(message) {}
55 };
56
57 class invalid_input_exception : public exception
58 {
59 public:
60 template <typename MessageType>
61 invalid_input_exception(const MessageType& message) : exception(message) {}
62 };
63
64 class format_exception : public exception
65 {
66 public:
67 template <typename MessageType>
68 format_exception(const MessageType& message) : exception(message) {}
69 };
70
71 class format_conversion_exception : public format_exception
72 {
73 public:
74 template <typename MessageType>
75 format_conversion_exception(const MessageType& message) : format_exception(message) {}
76 };
77
78 class runtime_exception : public exception
79 {
80 public:
81 template <typename MessageType>
82 runtime_exception(const MessageType& message) : exception(message) {}
83 };
84
85 } // end namespace cusp
86

  ViewVC Help
Powered by ViewVC 1.1.26