class ov::EnumMask

Overview

#include <enum_mask.hpp>

template <typename T>
class EnumMask
{
public:
    // typedefs

    typedef typename std::underlying_type<T>::type value_type;

    // construction

    EnumMask();
    EnumMask(const T& enum_value);
    EnumMask(const EnumMask& other);
    EnumMask(std::initializer_list<T> enum_values);

    // methods

    value_type value() const;
    bool is_any_set(const EnumMask& p) const;
    bool is_set(const EnumMask& p) const;
    bool is_any_clear(const EnumMask& p) const;
    bool is_clear(const EnumMask& p) const;
    void set(const EnumMask& p);
    void clear(const EnumMask& p);
    void clear_all();
    bool operator [] (const EnumMask& p) const;
    bool operator == (const EnumMask& other) const;
    bool operator != (const EnumMask& other) const;
    EnumMask& operator = (const EnumMask& other);
    EnumMask& operator &= (const EnumMask& other);
    EnumMask& operator|= (const EnumMask& other);
    EnumMask operator & (const EnumMask& other) const;
    EnumMask operator| (const EnumMask& other) const;
};

Detailed Documentation

Typedefs

typedef typename std::underlying_type<T>::type value_type

Make sure the template type is an enum.

Extract the underlying type of the enum.

Construction

EnumMask()

Some bit operations are not safe for signed values, we require enum type to use unsigned underlying type.

Methods

bool is_any_set(const EnumMask& p) const

Check if any of the input parameter enum bit mask match.

bool is_set(const EnumMask& p) const

Check if all of the input parameter enum bit mask match.

bool is_any_clear(const EnumMask& p) const

Check if any of the input parameter enum bit mask does not match.

bool is_clear(const EnumMask& p) const

Check if all of the input parameter enum bit mask do not match.