All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Friends | List of all members
sdf::Error Class Reference

#include <Error.hh>

Public Member Functions

 Error ()=default
 default constructor More...
 
 Error (const ErrorCode _code, const std::string &_message)
 Constructor. More...
 
ErrorCode Code () const
 Get the error code. More...
 
std::string Message () const
 Get the error message, which is a description of the error. More...
 
 operator bool () const
 Safe bool conversion. More...
 
bool operator== (const bool _value) const
 Compare this Error to a boolean value. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const sdf::Error &_err)
 Output operator for an error. More...
 

Constructor & Destructor Documentation

sdf::Error::Error ( )
default

default constructor

sdf::Error::Error ( const ErrorCode  _code,
const std::string &  _message 
)

Constructor.

Parameters
[in]_codeThe error code.
[in]_messageA description of the error.
See Also
ErrorCode.

Member Function Documentation

ErrorCode sdf::Error::Code ( ) const

Get the error code.

Returns
An error code.
See Also
ErrorCode.
std::string sdf::Error::Message ( ) const

Get the error message, which is a description of the error.

Returns
Error message.
sdf::Error::operator bool ( ) const
explicit

Safe bool conversion.

Returns
True if this Error's Code() != NONE. In otherwords, this is true when there is an error.
bool sdf::Error::operator== ( const bool  _value) const

Compare this Error to a boolean value.

Returns
True if the boolean evaluation of this Error equals _value. If _value == false, then true is returned when this Error's Code() is equal to NONE and false is returned otherwise. If _value == true, then true is returned when this Error's Code() is not equal to NONE and false is returned otherwise.
See Also
explicit operator bool() const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const sdf::Error _err 
)
friend

Output operator for an error.

Parameters
[in,out]_outThe output stream.
[in]_errThe error to output.
Returns
Reference to the given output stream

The documentation for this class was generated from the following file: