/[PAMELA software]/yoda/event/Exception.h
ViewVC logotype

Annotation of /yoda/event/Exception.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5.0 - (hide annotations) (download)
Mon Aug 29 09:45:48 2005 UTC (19 years, 3 months ago) by kusanagi
Branch: MAIN
CVS Tags: YODA5_0/00, YODA5_0/01, YODA5_0/02
Changes since 4.5: +1 -1 lines
File MIME type: text/plain
Starting form this version:
1) includes are defined with relative (not absolute) path respect to the YODA aplication
2) RegistryEvent class is foreseen to contain post-unpack data.

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

  ViewVC Help
Powered by ViewVC 1.1.23