IData/include/Exceptions.h

Go to the documentation of this file.
00001 #ifndef IDATA_EXCEPTIONS_H
00002 #define IDATA_EXCEPTIONS_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: Exceptions.h 7869 2014-03-13 07:14:52Z gapon@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 
00026 //------------------------------------
00027 // Collaborating Class Declarations --
00028 //------------------------------------
00029 
00030 //              ---------------------
00031 //              -- Class Interface --
00032 //              ---------------------
00033 
00034 namespace IData {
00035 
00036 /// @addtogroup IData
00037 
00038 /**
00039  *  @ingroup IData
00040  *
00041  *  @brief Base class for exception classes for PSEvt package.
00042  *
00043  *  This software was developed for the LCLS project.  If you use all or 
00044  *  part of it, please give an appropriate acknowledgment.
00045  *
00046  *  @version \$Id: Exceptions.h 7869 2014-03-13 07:14:52Z gapon@SLAC.STANFORD.EDU $
00047  *
00048  *  @author Andrei Salnikov
00049  */
00050 
00051 class Exception : public ErrSvc::Issue {
00052 public:
00053 
00054   /// Constructor takes the reason for an exception
00055   Exception(const ErrSvc::Context& ctx, const std::string& what);
00056 
00057 };
00058 
00059 /// Exception thrown when experiment name is not recognized
00060 class ExpNameException : public Exception {
00061 public:
00062 
00063   ExpNameException(const ErrSvc::Context& ctx, const std::string& name)
00064     : Exception(ctx, "experiment name or number is not recognized: " + name)
00065   {}
00066 
00067 };
00068 
00069 /// Exception thrown when run number is not recognized
00070 class RunNumberSpecException : public Exception {
00071 public:
00072 
00073   RunNumberSpecException(const ErrSvc::Context& ctx, const std::string& spec, const std::string& msg)
00074     : Exception(ctx, "invalid run number specification: '" + spec + "' -- "+ msg)
00075   {}
00076 
00077 };
00078 
00079 /// Error generated when dataset directory is not found
00080 class DatasetDirError : public Exception {
00081 public:
00082 
00083   DatasetDirError(const ErrSvc::Context& ctx, const std::string& str)
00084     : Exception(ctx, "dataset directory is missing: " + str) {}
00085 
00086 };
00087 
00088 /// Exception thrown when stream range is not recognized
00089 class StreamRangeSpecException : public Exception {
00090 public:
00091 
00092   StreamRangeSpecException(const ErrSvc::Context& ctx, const std::string& spec, const std::string& msg)
00093     : Exception(ctx, "invalid stream range specification: '" + spec + "' -- "+ msg)
00094   {}
00095 
00096 };
00097 
00098 } // namespace IData
00099 
00100 #endif // IDATA_EXCEPTIONS_H

Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7