File: EmException.h

package info (click to toggle)
pose 3.5-7
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 14,136 kB
  • ctags: 29,490
  • sloc: cpp: 93,990; ansic: 62,838; sh: 27,519; perl: 1,891; python: 1,242; makefile: 652
file content (96 lines) | stat: -rw-r--r-- 2,443 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* -*- mode: C++; tab-width: 4 -*- */
/* ===================================================================== *\
	Copyright (c) 2000-2001 Palm, Inc. or its subsidiaries.
	All rights reserved.

	This file is part of the Palm OS Emulator.

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 of the License, or
	(at your option) any later version.
\* ===================================================================== */

#ifndef EmException_h
#define EmException_h

#include <exception>
#include <string>

// ---------- EmException ----------

class EmException : public exception
{
	public:
								EmException			(void) throw ();
		virtual					~EmException		(void) throw ();
};


// ---------- EmExceptionTopLevelAction ----------
// This class of exception is used to escape back
// to the top level of the CPU loop and optionally
// perform some action there.

class EmExceptionTopLevelAction : public EmException
{
	public:
								EmExceptionTopLevelAction	(void) throw ();
		virtual					~EmExceptionTopLevelAction	(void) throw ();

		virtual void			DoAction			(void) = 0;
};


// ---------- EmExceptionEnterDebugger ----------

class EmExceptionEnterDebugger : public EmExceptionTopLevelAction
{
	public:
								EmExceptionEnterDebugger	(void) throw ();
		virtual					~EmExceptionEnterDebugger	(void) throw ();

		virtual void			DoAction			(void);
};


// ---------- EmExceptionReset ----------

class EmExceptionReset : public EmExceptionTopLevelAction
{
	public:
								EmExceptionReset	(EmResetType) throw ();
		virtual					~EmExceptionReset	(void) throw ();

		virtual void			DoAction			(void);

		void					SetException		(uint16 e)		{ fException = e; }
		void					SetMessage			(const char* m)	{ fMessage = m; }
		void					SetTrapWord			(uint16 tw)		{ fTrapWord = tw; }

		virtual const char*		what				(void) const throw ();

		void					Display				(void) const;

	private:
		EmResetType				fType;
		mutable string			fWhat;
		string					fMessage;
		uint16					fException;
		uint16					fTrapWord;
};


// ---------- EmExceptionNextGremlin ----------

class EmExceptionNextGremlin : public EmExceptionTopLevelAction
{
	public:
								EmExceptionNextGremlin	(void) throw ();
		virtual					~EmExceptionNextGremlin	(void) throw ();

		virtual void			DoAction			(void);
};


#endif	// EmException_h