11 #ifndef __PCP_CPP_EXCEPTION_HPP__ 12 #define __PCP_CPP_EXCEPTION_HPP__ 18 PCP_CPP_BEGIN_NAMESPACE
43 const std::string &
message = std::string())
44 : pm_error_code(pm_error_code),
48 #ifdef PM_MAXERRMSGLEN // pmErrStr_r and PM_MAXERRMSGLEN added in PCP 3.6.0. 49 char buffer[PM_MAXERRMSGLEN];
50 pmErrStr_r(pm_error_code, buffer,
sizeof(buffer));
53 this->
message.assign(pmErrStr(pm_error_code));
92 virtual const char *
what()
const throw()
104 PCP_CPP_END_NAMESPACE
exception(const int pm_error_code, const std::string &message=std::string())
Constructor.
Sets up common PMDA++ library macros.
exception(const pcp::exception &other)
Copy constructor.
Base class for all PMDA++ exceptions.
virtual ~exception()
Virtual destructor.
std::string message
Error message.
virtual int error_code() const
Get this exception's error code.
int pm_error_code
PCP error code.
virtual const char * what() const
Get this exception's error message.