39 #ifndef OME_COMMON_BOOLEAN_H
40 #define OME_COMMON_BOOLEAN_H
85 value(
std::numeric_limits<uint8_t>::min())
94 value(value ?
std::numeric_limits<uint8_t>::max() :
std::numeric_limits<uint8_t>::min())
111 operator bool()
const
113 return value != std::numeric_limits<uint8_t>::min();
125 this->
value = (rhs ? std::numeric_limits<uint8_t>::max() : std::numeric_limits<uint8_t>::min());
150 return !
static_cast<bool>(*this);
169 return static_cast<bool>(lhs) == rhs;
183 return lhs ==
static_cast<bool>(rhs);
197 return static_cast<bool>(lhs) == static_cast<bool>(rhs);
211 return static_cast<bool>(lhs) != rhs;
225 return lhs !=
static_cast<bool>(rhs);
239 return static_cast<bool>(lhs) != static_cast<bool>(rhs);
249 template<
class charT,
class traits>
250 inline std::basic_ostream<charT,traits>&
251 operator<< (std::basic_ostream<charT,traits>& os,
254 return os << static_cast<bool>(rhs);
264 template<
class charT,
class traits>
265 inline std::basic_istream<charT,traits>&
279 #endif // OME_COMMON_BOOLEAN_H
boolean operator!() const
Not operator.
Definition: boolean.h:148
uint8_t value
The boolean value.
Definition: boolean.h:155
boolean(bool value)
Construct with initial value.
Definition: boolean.h:93
bool operator!=(const boolean &lhs, bool rhs)
Compare boolean with bool for inequality.
Definition: boolean.h:208
boolean()
Default construct.
Definition: boolean.h:84
bool operator==(const boolean &lhs, bool rhs)
Compare boolean with bool for equality.
Definition: boolean.h:166
Boolean type with guaranteed size, alignment and storage values.
Definition: boolean.h:73
boolean & operator=(const boolean &rhs)
Assign value.
Definition: boolean.h:136
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
boolean(const boolean &value)
Copy construct.
Definition: boolean.h:102
boolean & operator=(bool rhs)
Assign value.
Definition: boolean.h:123
uint8_t value_type
Value type for Boolean values.
Definition: boolean.h:77
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, boolean &rhs)
Set boolean from input stream.
Definition: boolean.h:266