Xyce  6.1
N_DEV_Message.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------------
2 // Copyright Notice
3 //
4 // Copyright 2002 Sandia Corporation. Under the terms
5 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
6 // Government retains certain rights in this software.
7 //
8 // Xyce(TM) Parallel Electrical Simulator
9 // Copyright (C) 2002-2015 Sandia Corporation
10 //
11 // This program is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, see <http://www.gnu.org/licenses/>.
23 //-----------------------------------------------------------------------------
24 
25 //-----------------------------------------------------------------------------
26 // Filename : $RCSfile: N_DEV_Message.h,v $
27 //
28 // Purpose : Contains the class definition for the N_ERH_ErrorMgr
29 // class. This class is the error handler for Xyce.
30 //
31 // Special Notes :
32 //
33 // Creator : Eric Keiter, SNL, Parallel Computational Sciences
34 //
35 // Creation Date : 3/15/00
36 //
37 // Revision Information:
38 // ---------------------
39 //
40 // Revision Number: $Revision: 1.7 $
41 //
42 // Revision Date : $Date: 2015/04/08 19:18:22 $
43 //
44 // Current Owner : $Author: tvrusso $
45 //-----------------------------------------------------------------------------
46 
47 #ifndef Xyce_N_DEV_Message_h
48 #define Xyce_N_DEV_Message_h
49 
50 #include <N_DEV_fwd.h>
51 
52 #include <N_ERH_Message.h>
53 
54 namespace Xyce {
55 namespace Device {
56 
57 struct ParamWarning : public Report::UserWarning
58 {
59  ParamWarning(const DeviceEntity &device_entity);
60  ParamWarning(const Device &device);
61 };
62 
63 struct ParamError : public Report::UserError
64 {
65  ParamError(const DeviceEntity &device_entity);
66  ParamError(const Device &device);
67 };
68 
69 struct UserWarning : public Report::UserWarning
70 {
71  UserWarning(const DeviceEntity &device_entity);
72  UserWarning(const Device &device);
73 };
74 
75 struct UserWarning0 : public Report::UserWarning0
76 {
77  UserWarning0(const DeviceEntity &device_entity);
78  UserWarning0(const Device &device);
79 };
80 
81 struct UserError : public Report::UserError
82 {
83  UserError(const DeviceEntity &device_entity);
84  UserError(const Device &device);
85 };
86 
87 struct UserError0 : public Report::UserError0
88 {
89  UserError0(const DeviceEntity &device_entity);
90  UserError0(const Device &device);
91 };
92 
93 struct UserFatal : public Report::UserFatal
94 {
95  UserFatal(const DeviceEntity &device_entity);
96  UserFatal(const Device &device);
97 };
98 
99 struct UserFatal0 : public Report::UserFatal0
100 {
101  UserFatal0(const DeviceEntity &device_entity);
102  UserFatal0(const Device &device);
103 };
104 
105 struct DevelFatal : public Report::DevelFatal
106 {
107  DevelFatal(const DeviceEntity &device_entity, const char *function_name = 0);
108  DevelFatal(const Device &device, const char *function_name = 0);
109 };
110 
111 struct DevelFatal0 : public Report::DevelFatal0
112 {
113  DevelFatal0(const DeviceEntity &device_entity, const char *function_name = 0);
114  DevelFatal0(const Device &device, const char *function_name = 0);
115 };
116 
117 void device_assertion_error(const DeviceEntity &device_entity, const std::type_info &type, const char *label);
118 
119 
120 template <class T>
121 void Assert(bool test, const T &device_instance, const char *label)
122 {
123  if (!test)
124  device_assertion_error(device_instance, typeid(device_instance), label);
125 }
126 
127 } // namespace Device
128 } // namespace Xyce
129 
130 #define AssertLIDs(cmp) Assert(cmp, *this, #cmp)
131 
132 #endif // Xyce_N_DEV_Message_h
void Assert(bool test, const T &device_instance, const char *label)
Pure virtual class to augment a linear system.
DevelFatal0(const DeviceEntity &device_entity, const char *function_name=0)
UserWarning0(const DeviceEntity &device_entity)
UserError(const DeviceEntity &device_entity)
UserFatal(const DeviceEntity &device_entity)
ParamError(const DeviceEntity &device_entity)
Definition: N_DEV_Message.C:91
UserError0(const DeviceEntity &device_entity)
UserFatal0(const DeviceEntity &device_entity)
ParamWarning(const DeviceEntity &device_entity)
Definition: N_DEV_Message.C:83
The Device class is an interface for device implementations.
Definition: N_DEV_Device.h:101
DevelFatal(const DeviceEntity &device_entity, const char *function_name=0)
void device_assertion_error(const DeviceEntity &device_entity, const std::type_info &type, const char *label)
UserWarning(const DeviceEntity &device_entity)
Definition: N_DEV_Message.C:99