powerd++  0.4.4
error.hpp
Go to the documentation of this file.
1 
7 #ifndef _POWERDXX_SYS_ERROR_HPP_
8 #define _POWERDXX_SYS_ERROR_HPP_
9 
10 #include <cerrno> /* errno */
11 #include <cstring> /* strerror() */
12 
13 namespace sys {
14 
25 template <class Domain>
26 struct sc_error {
30  int error;
31 
38  operator int() const {
39  return this->error;
40  }
41 
48  char const * c_str() const {
49  return ::strerror(this->error);
50  }
51 };
52 
53 } /* namespace sys */
54 
55 #endif /* _POWERDXX_SYS_ERROR_HPP_ */
sys::sc_error::error
int error
The errno set by the native C function.
Definition: error.hpp:30
sys::sc_error
Can be thrown by syscall function wrappers if the function returned with an error.
Definition: error.hpp:26
sys
Wrappers around native system interfaces.
sys::sc_error::c_str
const char * c_str() const
Return c style string.
Definition: error.hpp:48