Program Listing for File exception.hpp

Return to documentation for file (/tmp/ws/src/ecl_core/ecl_exceptions/include/ecl/exceptions/exception.hpp)

/*****************************************************************************
** Ifdefs
*****************************************************************************/

#ifndef ECL_EXCEPTIONS_EXCEPTION_HPP_
#define ECL_EXCEPTIONS_EXCEPTION_HPP_

/*****************************************************************************
** Disable check
*****************************************************************************/

#include <ecl/config/ecl.hpp>
#ifndef ECL_DISABLE_EXCEPTIONS

/*****************************************************************************
** Includes
*****************************************************************************/

#include <exception>
#include <string>
#include "macros.hpp"

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace ecl {

/*****************************************************************************
** General exception
*****************************************************************************/
class ecl_exceptions_PUBLIC Exception : public std::exception
{
    public:
        virtual const char * what() const throw() = 0;
        virtual ~Exception() throw() {}
    protected:
        Exception() {}
        Exception(const char* loc ) : location(loc) {};

        std::string location;
};

} // namespace ecl

#endif /* ECL_DISABLE_EXCEPTIONS */
#endif /*ECL_EXCEPTIONS_EXCEPTION_HPP_*/