66 lines
1.5 KiB
C++
66 lines
1.5 KiB
C++
/**
|
|
* @file include/ActivMiddleware/ActivBase/LogMessageException.h
|
|
*
|
|
* @brief Header file for the LogMessageException class.
|
|
*/
|
|
|
|
#if (!defined ACTIV_BASE_LOG_MESSAGE_EXCEPTION_H)
|
|
#define ACTIV_BASE_LOG_MESSAGE_EXCEPTION_H
|
|
|
|
#include "ActivMiddleware/ActivBase/External.h"
|
|
#include "ActivMiddleware/ActivBase/ActivBase.h"
|
|
|
|
#include ACTIV_BOOST_INCLUDE(exception/all.hpp)
|
|
|
|
//! Activ namespace.
|
|
namespace Activ
|
|
{
|
|
|
|
/**
|
|
* @brief LogMessage exception class.
|
|
*
|
|
* Calls LogMessage() with the provided string. Useful to both log and throw an error.
|
|
*/
|
|
class LogMessageException : public virtual Boost::exception, public virtual std::exception
|
|
{
|
|
public:
|
|
/**
|
|
* @brief Constructor.
|
|
*
|
|
* @param logType
|
|
* @param pMessage string to log.
|
|
*/
|
|
ACTIV_BASE_API LogMessageException(const LogType logType, const char * const pMessage);
|
|
|
|
/**
|
|
* @brief Constructor.
|
|
*
|
|
* @param logType
|
|
* @param message string to log.
|
|
*/
|
|
ACTIV_BASE_API LogMessageException(const LogType logType, const String &message);
|
|
|
|
/**
|
|
* @brief Constructor.
|
|
*
|
|
* @param logType
|
|
* @param message string to log.
|
|
*/
|
|
ACTIV_BASE_API LogMessageException(const LogType logType, const BoostFormat &message);
|
|
|
|
/**
|
|
* @brief Destructor.
|
|
*/
|
|
ACTIV_BASE_API ~LogMessageException() throw();
|
|
|
|
// std::exception overrides.
|
|
ACTIV_BASE_API virtual const char *what() const throw() ACTIV_OVERRIDE;
|
|
|
|
private:
|
|
const String m_message;
|
|
};
|
|
|
|
} // namespace Activ
|
|
|
|
#endif // (!defined ACTIV_BASE_LOG_MESSAGE_EXCEPTION_H)
|