/[PAMELA software]/quicklook/OrbitalRate/inc/Exception.h
ViewVC logotype

Contents of /quicklook/OrbitalRate/inc/Exception.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Nov 3 22:11:17 2007 UTC (17 years, 1 month ago) by pam-rm2
Branch: MAIN
CVS Tags: v2r02, HEAD
Changes since 1.1: +17 -17 lines
File MIME type: text/plain
TDatime functions replaced by TTimeStamp.

1 /** @file
2 * $Source: /afs/ba.infn.it/user/pamela/src/CVS/yoda/event/Exception.h,v $
3 * $Id: Exception.h,v 6.0 2006/02/07 17:11:07 kusanagi Exp $
4 * $Author: kusanagi $
5 *
6 * Header file for the exceptions of Pamela.
7 */
8 #ifndef EXCEPTION_H
9 #define EXCEPTION_H
10 #include <exception>
11 #include <stdio.h>
12
13 #define UINT32 unsigned int
14 #define UINT16 unsigned short
15 #define UINT8 unsigned char
16
17 using namespace std;
18 namespace pamela {
19
20 class Exception: public exception {
21
22 private:
23
24 protected:
25 const char *message;
26 char buff [100];
27 public:
28 Exception(const char *msg = "message"): message(msg){ }
29 virtual ~Exception () throw(){ }
30 virtual const char* print () const throw () { return message; }
31 };
32
33 class NotFoundEnvironmentVarException: public Exception {
34 public:
35 NotFoundEnvironmentVarException(const char* msg): Exception(msg) {}
36 ~NotFoundEnvironmentVarException () throw(){ }
37 };
38
39 class UnidentifiedPacketException: public Exception {
40 private:
41 UINT8 pktId;
42 public:
43 UnidentifiedPacketException(UINT8 id):
44 Exception("Unidentified PacketType - Id: ") {
45 pktId = id;
46 }
47 ~UnidentifiedPacketException () throw(){ }
48 const char* print () const throw () {
49 sprintf((char*)buff," %s 0x%x", message, pktId);
50 return buff;
51 }
52 };
53
54 class WrongCRCException: public Exception {
55 public:
56 WrongCRCException(const char* msg): Exception(msg) {}
57 ~WrongCRCException () throw(){ }
58 };
59
60 class WrongCRCHeaderException: public Exception {
61 public:
62 WrongCRCHeaderException(const char* msg): Exception(msg) {}
63 ~WrongCRCHeaderException () throw(){ }
64 };
65
66
67 class LengthException: public Exception {
68 public:
69 LengthException(const char* msg): Exception(msg) { }
70 ~LengthException () throw(){ }
71 };
72
73
74 class NotExistingAlgorithmException: public Exception {
75 public:
76 NotExistingAlgorithmException(const char *msg): Exception(msg) { }
77 ~NotExistingAlgorithmException () throw(){ }
78 };
79
80 class NotExistingCounterException: public Exception {
81 public:
82 NotExistingCounterException(const char *msg): Exception(msg) { }
83 ~NotExistingCounterException () throw(){ }
84 };
85
86 class BackwardCounterException: public Exception {
87 public:
88 BackwardCounterException(const char *msg): Exception(msg) { }
89 ~BackwardCounterException () throw(){ }
90 };
91 }
92 #endif /* EXCEPTION_H */

  ViewVC Help
Powered by ViewVC 1.1.23