1 #ifndef AUDIOGRAPHER_FLAG_FIELD_H
2 #define AUDIOGRAPHER_FLAG_FIELD_H
8 #include <boost/operators.hpp>
18 :
public boost::less_than_comparable<FlagField>
19 , boost::equivalent<FlagField>
20 , boost::equality_comparable<FlagField>
29 :
public boost::less_than_comparable<iterator>
30 , boost::equivalent<iterator>
31 , boost::equality_comparable<iterator>
73 inline bool has (
Flag flag)
const {
return _flags & (1 << flag); }
75 inline operator bool()
const {
return _flags; }
76 inline void set (
Flag flag) { _flags |= (1 << flag); }
77 inline void remove (
Flag flag) { _flags &= ~(1 << flag); }
78 inline void reset () { _flags = 0; }
90 inline bool operator< (
FlagField const & other)
const {
return unsupported_flags_of (other); }
95 if (!*
this) {
return end(); }
96 if (!has (0)) { ++it; }
#define LIBAUDIOGRAPHER_API
Bi-directional iterator for flag set. Iterates over flags that are set in this field.
iterator(iterator const &other)
iterator(FlagField const &parent, Flag position)
std::bidirectional_iterator_tag iterator_category
value_type operator*() const
value_type const * operator->() const
bool has(Flag flag) const
FlagField(FlagField const &other)
FlagField unsupported_flags_of(FlagField const &other) const
Returns the flags in other that are not set in this field.
storage_type flags() const
FlagField(storage_type flags)