PSShmemInput/include/Exceptions.h

Go to the documentation of this file.
00001 #ifndef PSSHMEMINPUT_EXCEPTIONS_H
00002 #define PSSHMEMINPUT_EXCEPTIONS_H
00003 
00004 //--------------------------------------------------------------------------
00005 // File and Version Information:
00006 //      $Id: Exceptions.h 6177 2013-04-29 21:55:17Z salnikov@SLAC.STANFORD.EDU $
00007 //
00008 // Description:
00009 //      Class Exceptions.
00010 //
00011 //------------------------------------------------------------------------
00012 
00013 //-----------------
00014 // C/C++ Headers --
00015 //-----------------
00016 #include <string>
00017 #include <cerrno>
00018 #include <boost/lexical_cast.hpp>
00019 
00020 //----------------------
00021 // Base Class Headers --
00022 //----------------------
00023 #include "ErrSvc/Issue.h"
00024 
00025 //-------------------------------
00026 // Collaborating Class Headers --
00027 //-------------------------------
00028 
00029 //------------------------------------
00030 // Collaborating Class Declarations --
00031 //------------------------------------
00032 
00033 //              ---------------------
00034 //              -- Class Interface --
00035 //              ---------------------
00036 
00037 /**
00038  *  Exception classes
00039  *
00040  *  This software was developed for the LUSI project.  If you use all or
00041  *  part of it, please give an appropriate acknowledgement.
00042  *
00043  *  @version $Id: Exceptions.h 6177 2013-04-29 21:55:17Z salnikov@SLAC.STANFORD.EDU $
00044  *
00045  *  @author Andrei Salnikov
00046  */
00047 
00048 namespace PSShmemInput {
00049 
00050 class Exception : public ErrSvc::Issue {
00051 public:
00052 
00053   // Constructor
00054   Exception ( const ErrSvc::Context& ctx, 
00055               const std::string& className, 
00056               const std::string& what )
00057     : ErrSvc::Issue(ctx, className+": "+what)
00058   {}
00059 
00060 };
00061 
00062 // thrown for empty input list
00063 class EmptyInputList : public Exception {
00064 public:
00065 
00066   EmptyInputList(const ErrSvc::Context& ctx)
00067     : Exception( ctx, "EmptyInputList", "No input source name specified" ) {}
00068 
00069 };
00070 
00071 // thrown for too long input list
00072 class DatasetSpecError : public Exception {
00073 public:
00074 
00075   DatasetSpecError(const ErrSvc::Context& ctx, const std::string& err, const std::string& spec)
00076     : Exception( ctx, "DatasetSpecError", "Dataset specification error: " + err + " (" + spec + ")" ) {}
00077 
00078 };
00079 
00080 } // namespace PSXtcInput
00081 
00082 #endif // PSSHMEMINPUT_EXCEPTIONS_H

Generated on 19 Dec 2016 for PSANAclasses by  doxygen 1.4.7