19 #ifndef EQFABRIC_ERROR_H
20 #define EQFABRIC_ERROR_H
22 #include <eq/fabric/api.h>
23 #include <eq/fabric/types.h>
34 typedef void (
Error::*bool_t)()
const;
35 void bool_true()
const {}
39 EQFABRIC_API
Error(
const uint32_t code,
40 const uint128_t& originator = uint128_t( ));
46 EQFABRIC_API
operator bool_t()
const;
52 EQFABRIC_API uint32_t
getCode()
const;
58 EQFABRIC_API
bool operator == (
const Error& rhs )
const;
61 EQFABRIC_API
bool operator != (
const Error& rhs )
const;
64 EQFABRIC_API
bool operator == (
const uint32_t code )
const;
67 EQFABRIC_API
bool operator != (
const uint32_t code )
const;
70 EQFABRIC_API
void serialize( co::DataOStream& os )
const;
71 EQFABRIC_API
void deserialize( co::DataIStream& is );
74 friend void lunchbox::byteswap< Error >( Error& value );
77 uint128_t _originator;
81 EQFABRIC_API std::ostream& operator << ( std::ostream& os,
const Error& );
90 byteswap( value._code );
91 byteswap( value._originator );
95 #endif // EQFABRIC_ERROR_H
EQFABRIC_API const uint128_t & getOriginator() const
EQFABRIC_API uint32_t getCode() const
ErrorCode
Defines errors produced by Equalizer classes.
A wrapper for error codes to allow intuitive bool-like usage.
EQFABRIC_API bool operator==(const Error &rhs) const
EQFABRIC_API bool operator!=(const Error &rhs) const
EQFABRIC_API Error & operator=(const ErrorCode code)
Assign the given error code.
EQFABRIC_API bool operator!() const