ExceptionBase.h

// ExceptionBase.h
//
// Author David Barrett-Lennard
// (C)opyright Cedanet Pty Ltd 2008

#pragma once
#ifndef Ceda_cxUtils_ExceptionBase_H
#define Ceda_cxUtils_ExceptionBase_H

#include "cxUtils.h"
#include "IException.h"
#include "xstring.h"

namespace ceda
{
class xostream;

///////////////////////////////////////////////////////////////////////////////////////////////////
// ExceptionBase

class cxUtils_API ExceptionBase : public IException
{
public:
    ExceptionBase() {}
    ExceptionBase(ConstStringZ description);

    virtual void Write(xostream& os) const;

private:
    // This might be bad practice - to embed an object whose copy constructor could
    // throw an exception.  This could cause std::terminate() at the throw point.

    #pragma warning(suppress: 4251)
    xstring m_description;
};

} // namespace ceda

#endif // include guard