4.6.0
Freundlich's C++ toolkit
|
A statically sized bitfield.
ElementType | An enumeration type. |
InternalType | The internal storage type. Must be unsigned. This is fcppt::container::bitfield::default_internal_type by default. |
See fcppt.container.bitfield for more information.
Public Types | |
using | element_type = ElementType |
using | internal_type |
The value type of the underlying array. | |
using | static_size = fcppt::enum_::size<element_type> |
The number of array elements. | |
using | array_type = fcppt::container::bitfield::array<static_size, internal_type> |
The internal array type. | |
using | array_size = fcppt::array::size<array_type> |
The size of the underlying array. | |
using | size_type = typename static_size::value_type |
The size type which is taken from static_size . | |
using | value_type = fcppt::container::bitfield::value_type |
The value type, which is bool. | |
using | reference = fcppt::container::bitfield::proxy<array_type> |
A type denoting a reference to a mask value (a reference to a boolean, basically). | |
using | const_reference = fcppt::container::bitfield::proxy<array_type const> |
A type denoting a const reference to a mask value (a reference to a boolean, basically). | |
using | initializer_list_type = std::initializer_list<ElementType> |
Initializer list type used to initialize a bitfield. | |
Public Member Functions | |
object (fcppt::no_init const &) | |
Constructs an uninitialized bitfield. | |
object (initializer_list_type const &) | |
Constructs a bitfield using an initializer list, setting every bit from the list to true. | |
object (array_type const &) | |
Constructs a bitfield from its internal array type. | |
const_reference | operator[] (ElementType) const |
Returns a const reference to the specified bit. | |
reference | operator[] (ElementType) |
Returns a reference to the specified bit. | |
void | set (ElementType where, value_type value) |
Sets the specified bit to true/false. | |
value_type | get (ElementType) const |
Returns if the specified bit is set. | |
array_type & | array () |
Accessor to the internal array. | |
array_type const & | array () const |
Const accessor to the internal array. | |
Static Public Member Functions | |
static object | null () |
Returns the bitfield with all bits set to zero. | |
using fcppt::container::bitfield::object< ElementType, InternalType >::array_size = fcppt::array::size<array_type> |
The size of the underlying array.
using fcppt::container::bitfield::object< ElementType, InternalType >::array_type = fcppt::container::bitfield::array<static_size, internal_type> |
The internal array type.
using fcppt::container::bitfield::object< ElementType, InternalType >::const_reference = fcppt::container::bitfield::proxy<array_type const> |
A type denoting a const reference to a mask value (a reference to a boolean, basically).
Note that this is not a bool
nor an internal_type
, but a proxy class.
using fcppt::container::bitfield::object< ElementType, InternalType >::element_type = ElementType |
using fcppt::container::bitfield::object< ElementType, InternalType >::initializer_list_type = std::initializer_list<ElementType> |
Initializer list type used to initialize a bitfield.
using fcppt::container::bitfield::object< ElementType, InternalType >::internal_type |
The value type of the underlying array.
using fcppt::container::bitfield::object< ElementType, InternalType >::reference = fcppt::container::bitfield::proxy<array_type> |
A type denoting a reference to a mask value (a reference to a boolean, basically).
Note that this is not a bool
nor an internal_type
, but a proxy class.
using fcppt::container::bitfield::object< ElementType, InternalType >::size_type = typename static_size::value_type |
The size type which is taken from static_size
.
using fcppt::container::bitfield::object< ElementType, InternalType >::static_size = fcppt::enum_::size<element_type> |
The number of array elements.
using fcppt::container::bitfield::object< ElementType, InternalType >::value_type = fcppt::container::bitfield::value_type |
The value type, which is bool.
|
explicit |
Constructs an uninitialized bitfield.
fcppt::container::bitfield::object< ElementType, InternalType >::object | ( | initializer_list_type const & | ) |
Constructs a bitfield using an initializer list, setting every bit from the list to true.
|
explicit |
Constructs a bitfield from its internal array type.
|
nodiscard |
Accessor to the internal array.
|
nodiscard |
Const accessor to the internal array.
|
nodiscard |
Returns if the specified bit is set.
|
staticnodiscard |
Returns the bitfield with all bits set to zero.
|
nodiscard |
Returns a reference to the specified bit.
|
nodiscard |
Returns a const reference to the specified bit.
void fcppt::container::bitfield::object< ElementType, InternalType >::set | ( | ElementType | where, |
value_type | value ) |
Sets the specified bit to true/false.