Main Page
Modules
Namespaces
Classes
Files
File List
File Members
include
ecl
exceptions
posix_error_handler.hpp
Go to the documentation of this file.
1
13
/*****************************************************************************
14
** Ifdefs
15
*****************************************************************************/
16
17
#ifndef ECL_EXCEPTIONS_POSIX_EXCEPTION_HPP_
18
#define ECL_EXCEPTIONS_POSIX_EXCEPTION_HPP_
19
20
/*****************************************************************************
21
** Disable check
22
*****************************************************************************/
23
24
#include <ecl/config/ecl.hpp>
25
#ifndef ECL_DISABLE_EXCEPTIONS
26
27
/*****************************************************************************
28
** Includes
29
*****************************************************************************/
30
31
#include <cstring>
// strerror function
32
#include <string>
33
#include <errno.h>
34
#include "
standard_exception.hpp
"
35
36
/*****************************************************************************
37
** Namespaces
38
*****************************************************************************/
39
40
namespace
ecl
{
41
42
/*****************************************************************************
43
** Interface [PosixErrorHandler]
44
*****************************************************************************/
57
template
<
typename
ThrowingClass>
58
class
ecl_exceptions_PUBLIC
PosixErrorHandler {
59
public
:
69
static
StandardException GenerateStandardException(
const
char
* loc) {
70
return
StandardException(loc,
PosixError
, std::string(strerror(errno))+
"."
);
71
}
72
virtual
~PosixErrorHandler() {}
73
};
74
75
};
// namespace ecl
76
77
#endif
/* ECL_DISABLE_EXCEPTIONS */
78
#endif
/* ECL_EXCEPTIONS_POSIX_EXCEPTION_HPP_ */
ecl
ecl_exceptions_PUBLIC
#define ecl_exceptions_PUBLIC
Definition:
exceptions/macros.hpp:37
standard_exception.hpp
ecl::PosixError
PosixError
xbot_node
Author(s): Roc, wangpeng@droid.ac.cn
autogenerated on Sat Oct 10 2020 03:28:13