39 #ifndef OME_COMMON_BOOLEAN_H 40 #define OME_COMMON_BOOLEAN_H 48 #pragma push_macro("min") 50 #pragma push_macro("max") 91 value(
std::numeric_limits<uint8_t>::min())
100 value(value ?
std::numeric_limits<uint8_t>::max() :
std::numeric_limits<uint8_t>::min())
117 operator bool()
const 119 return value != std::numeric_limits<uint8_t>::min();
131 this->
value = (rhs ? std::numeric_limits<uint8_t>::max() : std::numeric_limits<uint8_t>::min());
156 return !
static_cast<bool>(*this);
175 return static_cast<bool>(lhs) == rhs;
189 return lhs ==
static_cast<bool>(rhs);
203 return static_cast<bool>(lhs) == static_cast<bool>(rhs);
217 return static_cast<bool>(lhs) != rhs;
231 return lhs !=
static_cast<bool>(rhs);
245 return static_cast<bool>(lhs) != static_cast<bool>(rhs);
255 template<
class charT,
class traits>
256 inline std::basic_ostream<charT,traits>&
257 operator<< (std::basic_ostream<charT,traits>& os,
260 return os << static_cast<bool>(rhs);
270 template<
class charT,
class traits>
271 inline std::basic_istream<charT,traits>&
286 #pragma pop_macro("min") 287 #pragma pop_macro("max") 290 #endif // OME_COMMON_BOOLEAN_H uint8_t value
The boolean value.
Definition: boolean.h:161
boolean(bool value)
Construct with initial value.
Definition: boolean.h:99
bool operator!=(const boolean &lhs, bool rhs)
Compare boolean with bool for inequality.
Definition: boolean.h:214
boolean()
Default construct.
Definition: boolean.h:90
bool operator==(const boolean &lhs, bool rhs)
Compare boolean with bool for equality.
Definition: boolean.h:172
boolean operator!() const
Not operator.
Definition: boolean.h:154
Boolean type with guaranteed size, alignment and storage values.
Definition: boolean.h:79
boolean & operator=(const boolean &rhs)
Assign value.
Definition: boolean.h:142
Open Microscopy Environment C++.
Definition: base64.h:48
boolean(const boolean &value)
Copy construct.
Definition: boolean.h:108
boolean & operator=(bool rhs)
Assign value.
Definition: boolean.h:129
uint8_t value_type
Value type for Boolean values.
Definition: boolean.h:83
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, boolean &rhs)
Set boolean from input stream.
Definition: boolean.h:272