source: anotherchoice/tags/jsp-1.4.4-full-UTF8/cfg/base/except.h@ 363

Last change on this file since 363 was 363, checked in by ykominami, 5 years ago

add tags/jsp-1.4.4-full-UTF8

  • Property svn:executable set to *
File size: 4.6 KB
Line 
1/*
2 * TOPPERS/JSP Kernel
3 * Toyohashi Open Platform for Embedded Real-Time Systems/
4 * Just Standard Profile Kernel
5 *
6 * Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
7 * Toyohashi Univ. of Technology, JAPAN
8 *
9 * 上記著作権者
10は,以下の (1)〜(4) の条件か,Free Software Foundation
11 * によってå…
12¬è¡¨ã•ã‚Œã¦ã„ã‚‹ GNU General Public License の Version 2 に記
13 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
14 * を改変したものを含む.以下同じ)を使用・複製・改変・再é…
15å¸ƒï¼ˆä»¥ä¸‹ï¼Œ
16 * 利用と呼ぶ)することを無償で許諾する.
17 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
18 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
19 * スコード中に含まれていること.
20 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
21 * 用できる形で再é…
22å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œå†é…
23å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨
24 * 者
25マニュアルなど)に,上記の著作権表示,この利用条件および下記
26 * の無保証規定を掲載すること.
27 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
28 * 用できない形で再é…
29å¸ƒã™ã‚‹å ´åˆã«ã¯ï¼Œæ¬¡ã®ã„ずれかの条件を満たすこ
30 * と.
31 * (a) 再é…
32å¸ƒã«ä¼´ã†ãƒ‰ã‚­ãƒ¥ãƒ¡ãƒ³ãƒˆï¼ˆåˆ©ç”¨è€…
33マニュアルなど)に,上記の著
34 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
35 * (b) 再é…
36å¸ƒã®å½¢æ…
37‹ã‚’,別に定める方法によって,TOPPERSプロジェクトに
38 * 報告すること.
39 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
40 * 害からも,上記著作権者
41およびTOPPERSプロジェクトをå…
42è²¬ã™ã‚‹ã“と.
43 *
44 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者
45お
46 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
47 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
48 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
49 *
50 * @(#) $Id: except.h,v 1.9 2003/12/20 06:51:58 takayuki Exp $
51 */
52
53// $Header: /home/CVS/configurator/base/except.h,v 1.9 2003/12/20 06:51:58 takayuki Exp $
54
55#ifndef EXCEPT_H
56#define EXCEPT_H
57
58#ifdef _MSC_VER
59# pragma warning(disable:4290) //C++ の例外の指定は無視されます。関数が __declspec(nothrow) でないことのみ表示されます。
60#endif
61
62//#include "testsuite.h"
63
64#include <string>
65#include <typeinfo>
66
67 //例外基底クラス
68class Exception
69{
70private:
71 static bool is_throwable;
72
73protected:
74 int code; //例外コード
75 std::string classname; //この例外を生成したクラスの名前 (識別用)
76 std::string details; //例外の説明
77
78 //コンストラクタ
79 Exception(std::string classname = "Exception", int code = 0, std::string details = "") throw();
80 Exception(std::string classname, std::string details) throw();
81
82 //デストラクタ
83public:
84 Exception(const Exception & src) throw();
85
86 virtual ~Exception(void) throw();
87
88 //is-an-instance-of関係の評価
89 inline bool isInstanceOf(const char * _classname) const throw()
90 { return classname.compare(_classname) == 0; }
91
92 //例外コードを取得する
93 inline int getCode(void) const throw()
94 { return code; }
95
96 //例外の説明を取得する
97 inline std::string getDetails(void) const throw()
98 { return details; }
99
100 //現在の例外制御フラグの状æ…
101‹ã«å¾“って例外を発行する
102 inline bool throwException(void)
103 {
104 if(is_throwable)
105 throw *this;
106 return is_throwable;
107 }
108
109 //is_throwableのアクセサ
110 static void setThrowControl(bool _throwable) throw()
111 { is_throwable = _throwable; }
112
113 static bool getThrowControl(void) throw()
114 { return is_throwable; }
115
116
117// TESTSUITE_PROTOTYPE(main)
118};
119
120
121#define EXCEPTION(x) class x : public Exception { public: x(void) throw() : Exception(#x) {} };
122#define EXCEPTION_(x,y) class x : public Exception { public: x(void) throw() : Exception(#x, y) {} };
123#define EXCEPTION__(x,y,z) class x : public Exception { public: x(void) throw() : Exception(#x, y, z) {} };
124
125#endif
126
127
128
Note: See TracBrowser for help on using the repository browser.