Template Class desfire::key_actor
Defined in File key_actor.hpp
Class Documentation
-
template<class SpecialT>
class key_actor Variant structure that at a given time represents either one key index, or one of two special values, one of which being no_key (i.e. no key has the given right) or a custom meaning implied by the template parameter. This class can be packed into a nibble (i.e. a 4 bits sequence).
- Template Parameters:
SpecialT – Monostate structure type which represents the other special value used in alternative to the no_key special value, e.g. free_access_t or same_key_t.
Assignment operators mimicking constructors
Comparison operators
Public Functions
-
inline void set_nibble(std::uint8_t v)
Sets the value of this class based on the lower nibble of
v
.- Parameters:
v – Value representing the key actor.
-
inline std::uint8_t get_nibble() const
Returns a byte whose lower nibble contains a numeric representation of this class.
- Returns:
A byte masked by 0xF, the lower 4 bits contain the representation of the key actor.
-
constexpr key_actor()
Default-constructs this class with the key index 0.
-
constexpr key_actor(std::uint8_t key_index)
Creates a key actor referencing the given
key_index
.- Parameters:
key_index – A value between 0 and 13 (included).
-
key_actor(bool) = delete
Prevent accidental conversions from bool.