algorithm_factory_exception.cpp

Go to the documentation of this file.
00001 //--------------------------------------------------
00011 //---------------------------------------------------
00012 
00013 #include "algorithm_factory_exception.h"
00014 
00015 namespace imedgine {
00016 
00017   //--------------------------------------------------
00018 
00019   AlgorithmFactoryException::AlgorithmFactoryException(int type, std::string detail)
00020     : Exception(ALGORITHM_FACTORY_EXCEPTION, detail),
00021       type_(type),
00022       detail_(detail)
00023   {
00024   }
00025 
00026   //--------------------------------------------------
00027 
00028   AlgorithmFactoryException::~AlgorithmFactoryException() throw()
00029   {
00030   }
00031 
00032   //--------------------------------------------------
00033 
00034   char const* AlgorithmFactoryException::what() const throw()
00035   {
00036         // TODO: switch exception types
00037     switch (type_) {
00038         case LOADING_LIBRARY_FAILED:
00039            return "Loading library failed";
00040         case INVALID_LIBRARY:
00041            return "Invalid library";
00042         case DUPLICATE_LIBRARY_NAME:
00043            return "Duplicate library name";
00044         default:
00045            return "unspecified AlgorithmFactoryException";
00046     }
00047     return "AlgorithmFactoryException";
00048   }
00049 
00050   //--------------------------------------------------
00051 
00052   const int AlgorithmFactoryException::getType() const
00053   {
00054     return(type_);
00055   }
00056 
00057   //--------------------------------------------------
00058 
00059   std::string const& AlgorithmFactoryException::getDetail() const
00060   {
00061     return(detail_);
00062   }
00063 }

Generated on Sun Aug 13 18:19:39 2006 for iMEDgine by  doxygen 1.4.6