blob: 12887390083acdd21576b9920b675fea807c6211 [file] [log] [blame]
#ifndef STATEFLAGS_H
#define STATEFLAGS_H
#include <cstdint>
class StateFlags
{
public:
// MARK is used to indicate that sub-objects
// of the marked object have warnings or alerts
enum class state : uint16_t
{
NORM,
MARK,
WARN,
ALERT
};
StateFlags() = default;
StateFlags(const StateFlags& orig) = default;
StateFlags& operator=(const StateFlags& orig) = default;
StateFlags(StateFlags&& orig) = default;
StateFlags& operator=(StateFlags&& orig) = default;
virtual ~StateFlags() noexcept
{
}
virtual bool has_mark_state() const;
virtual bool has_warn_state() const;
virtual bool has_alert_state() const;
virtual void set_mark();
virtual void set_warn();
virtual void set_alert();
virtual state get_state() const;
virtual void clear_state_flags();
virtual state update_state_flags() = 0;
protected:
state obj_state {StateFlags::state::NORM};
};
#endif /* STATEFLAGS_H */