diff options
Diffstat (limited to 'libs/audiographer/audiographer/types.h')
-rw-r--r-- | libs/audiographer/audiographer/types.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/audiographer/audiographer/types.h b/libs/audiographer/audiographer/types.h index f48f8f807a..5d31899748 100644 --- a/libs/audiographer/audiographer/types.h +++ b/libs/audiographer/audiographer/types.h @@ -18,10 +18,15 @@ class FlagField { FlagField() : _flags (0) {} FlagField(FlagField const & other) : _flags (other._flags) {} - inline bool has (Flag flag) const { return _flags & (1 << flag); } - inline void set (Flag flag) { _flags |= (1 << flag); } - inline void remove (Flag flag) { _flags &= ~(1 << flag); } - inline storage_type flags () const { return _flags; } + inline bool has (Flag flag) const { return _flags & (1 << flag); } + inline storage_type flags () const { return _flags; } + inline operator bool() const { return _flags; } + inline void set (Flag flag) { _flags |= (1 << flag); } + inline void remove (Flag flag) { _flags &= ~(1 << flag); } + inline void reset () { _flags = 0; } + + inline FlagField & operator+= (FlagField const & other) { _flags |= other._flags; return *this; } + inline bool operator== (FlagField const & other) const { return _flags == other._flags; } private: storage_type _flags; |