--- yoda/event/Exception.h 2004/12/03 22:04:04 2.1 +++ yoda/event/Exception.h 2006/02/04 12:37:43 5.1 @@ -1,7 +1,7 @@ /** @file * $Source: /home/cvsmanager/yoda/event/Exception.h,v $ - * $Id: Exception.h,v 2.0 2004/09/21 20:49:57 kusanagi Exp $ - * $Author: kusanagi $ + * $Id: Exception.h,v 5.0 2005/08/29 09:45:48 Maurizio Nagni Exp $ + * $Author: Maurizio Nagni $ * * Header file for the exceptions of Pamela. */ @@ -9,7 +9,10 @@ #define EXCEPTION_H #include #include -#include "SubPacket.h" + +#define UINT32 unsigned int +#define UINT16 unsigned short +#define UINT8 unsigned char using namespace std; namespace pamela { @@ -27,6 +30,12 @@ virtual const char* print () const throw () { return message; } }; + class NotFoundEnvironmentVarException: public Exception { + public: + NotFoundEnvironmentVarException::NotFoundEnvironmentVarException(const char* msg): Exception(msg) {} + NotFoundEnvironmentVarException::~NotFoundEnvironmentVarException () throw(){ } + }; + class UnidentifiedPacketException: public Exception { private: UINT8 pktId; @@ -44,30 +53,21 @@ class WrongCRCException: public Exception { public: - WrongCRCException::WrongCRCException(char* msg): Exception(msg) {} + WrongCRCException::WrongCRCException(const char* msg): Exception(msg) {} WrongCRCException::~WrongCRCException () throw(){ } - const char* WrongCRCException::print () const throw () { - return message; - } }; class WrongCRCHeaderException: public Exception { public: - WrongCRCHeaderException::WrongCRCHeaderException(): Exception() {} + WrongCRCHeaderException::WrongCRCHeaderException(const char* msg): Exception(msg) {} WrongCRCHeaderException::~WrongCRCHeaderException () throw(){ } - const char* WrongCRCHeaderException::print () const throw () { - return "CRC Header Exception"; - } }; class LengthException: public Exception { public: - LengthException::LengthException(char* msg): Exception(msg) { } + LengthException::LengthException(const char* msg): Exception(msg) { } LengthException::~LengthException () throw(){ } - const char* LengthException::print () const throw () { - return message; - } }; @@ -75,19 +75,18 @@ public: NotExistingAlgorithmException::NotExistingAlgorithmException(const char *msg): Exception(msg) { } NotExistingAlgorithmException::~NotExistingAlgorithmException () throw(){ } - const char* NotExistingAlgorithmException::print () const throw () { - return strcat("\n No way to read events of type ", message); - } }; class NotExistingCounterException: public Exception { public: NotExistingCounterException::NotExistingCounterException(const char *msg): Exception(msg) { } NotExistingCounterException::~NotExistingCounterException () throw(){ } - const char* NotExistingCounterException::print () const throw () { - return strcat("\n No counter of type ", message); - } }; + class BackwardCounterException: public Exception { + public: + BackwardCounterException::BackwardCounterException(const char *msg): Exception(msg) { } + BackwardCounterException::~BackwardCounterException () throw(){ } + }; } #endif /* EXCEPTION_H */