diff options
Diffstat (limited to 'src/flags.h')
-rw-r--r-- | src/flags.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/flags.h b/src/flags.h index e68884ca..16d205d9 100644 --- a/src/flags.h +++ b/src/flags.h @@ -1,7 +1,7 @@ #ifndef _FLAGS_H #define _FLAGS_H -template <typename T = uint_least8_t> +template <typename T = boost::uint_least8_t> class supports_flags { public: @@ -35,4 +35,38 @@ public: } }; +template <typename T = boost::uint_least8_t> +class delegates_flags : public boost::noncopyable +{ +public: + typedef T flags_t; + +protected: + supports_flags<T>& flags_; + +public: + delegates_flags() : flags_() {} + delegates_flags(supports_flags<T>& arg) : flags_(arg) {} + + flags_t flags() const { + return flags_.flags(); + } + bool has_flags(const flags_t arg) const { + return flags_.has_flags(arg); + } + + void set_flags(const flags_t arg) { + flags_.set_flags(arg); + } + void clear_flags() { + flags_.clear_flags(); + } + void add_flags(const flags_t arg) { + flags_.add_flags(arg); + } + void drop_flags(const flags_t arg) { + flags_.drop_flags(arg); + } +}; + #endif // _FLAGS_H |