00001 #ifndef PSEVT_EXCEPTIONS_H 00002 #define PSEVT_EXCEPTIONS_H 00003 00004 //-------------------------------------------------------------------------- 00005 // File and Version Information: 00006 // $Id: Exceptions.h 7525 2014-01-13 19:52:29Z salnikov@SLAC.STANFORD.EDU $ 00007 // 00008 // Description: 00009 // Class Exceptions. 00010 // 00011 //------------------------------------------------------------------------ 00012 00013 //----------------- 00014 // C/C++ Headers -- 00015 //----------------- 00016 00017 //---------------------- 00018 // Base Class Headers -- 00019 //---------------------- 00020 #include "ErrSvc/Issue.h" 00021 00022 //------------------------------- 00023 // Collaborating Class Headers -- 00024 //------------------------------- 00025 #include "pdsdata/xtc/Src.hh" 00026 #include "PSEvt/EventKey.h" 00027 00028 //------------------------------------ 00029 // Collaborating Class Declarations -- 00030 //------------------------------------ 00031 00032 // --------------------- 00033 // -- Class Interface -- 00034 // --------------------- 00035 00036 namespace PSEvt { 00037 00038 /** 00039 * @brief Base class for exception classes for PSEvt package. 00040 * 00041 * This software was developed for the LCLS project. If you use all or 00042 * part of it, please give an appropriate acknowledgment. 00043 * 00044 * @version \$Id: Exceptions.h 7525 2014-01-13 19:52:29Z salnikov@SLAC.STANFORD.EDU $ 00045 * 00046 * @author Andrei Salnikov 00047 */ 00048 00049 class Exception: public ErrSvc::Issue { 00050 public: 00051 00052 /// Constructor takes the reason for an exception 00053 Exception(const ErrSvc::Context& ctx, const std::string& what); 00054 00055 }; 00056 00057 /// Exception thrown when trying to store multiple objects with the same key 00058 class ExceptionDuplicateKey: public Exception { 00059 public: 00060 00061 ExceptionDuplicateKey(const ErrSvc::Context& ctx, const EventKey& key); 00062 00063 }; 00064 00065 /// Exception thrown when Source format string is not recognized 00066 class ExceptionSourceFormat: public Exception { 00067 public: 00068 00069 ExceptionSourceFormat(const ErrSvc::Context& ctx, const std::string& format); 00070 00071 }; 00072 00073 /// Exception thrown when alias names are used without alias map 00074 class ExceptionNoAliasMap: public Exception { 00075 public: 00076 00077 ExceptionNoAliasMap(const ErrSvc::Context& ctx); 00078 00079 }; 00080 00081 } // namespace PSEvt 00082 00083 #endif // PSEVT_EXCEPTIONS_H