|
| template<class BFSM , std::size_t BFSz = sizeof(typename std::underlying_type<typename boost::mpl::deref<typename boost::mpl::begin<BFSM>::type>::type::first::value_type>::type)> |
| class jmmcg::LIBJMMCG_VER_NAMESPACE::bitfield_map | jmmcg::LIBJMMCG_VER_NAMESPACE::__attribute__ ((packed)) |
| |
| | BOOST_MPL_ASSERT ((std::is_pod< bitfields_tags_type >)) |
| |
| | BOOST_MPL_ASSERT ((std::is_integral< typename std::underlying_type< bitfields_tags_type >::type >)) |
| |
| | BOOST_MPL_ASSERT_RELATION (sizeof(bitfields_tags_type),<=, sizeof(key_type)) |
| |
| | BOOST_MPL_ASSERT_RELATION (sizeof(underlying_key_type),==, sizeof(bitfields_tags_type)) |
| |
| | BOOST_MPL_ASSERT_RELATION (range_mapped_types_size, >, 0) |
| |
| | BOOST_MPL_ASSERT_RELATION (boost::mpl::empty< mapped_types >::value, !=, true) |
| |
| constexpr | bitfield_map () noexcept(true) FORCE_INLINE |
| | Default-construct an empty container. More...
|
| |
| constexpr | bitfield_map (bitfield_map const &) noexcept(true) FORCE_INLINE |
| | Bit-wise copy the contents of the argument into the constructed container, out of the argument. More...
|
| |
| constexpr | bitfield_map (bitfield_map &&) noexcept(true) FORCE_INLINE |
| |
| | ~bitfield_map () noexcept(true) FORCE_INLINE |
| |
| constexpr bitfield_map & | operator= (bitfield_map &&) noexcept(true) FORCE_INLINE |
| | Bit-wise swap the contents of the container with that of the argument. More...
|
| |
| constexpr bool | empty () const noexcept(true) FORCE_INLINE |
| | Indicate if there are any elements selected in the mapped_types. More...
|
| |
| constexpr size_type | size () const noexcept(true) FORCE_INLINE |
| | Indicate the total size of any elements selected in the mapped_types, including the size of the domain bitfield. More...
|
| |
| constexpr void | clear () noexcept(true) FORCE_INLINE |
| | Erase each enabled mapped_types selected in the key_type. More...
|
| |
| template<bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Ret = typename boost::mpl::at<mapped_types, AsType>::type> |
| constexpr const Ret & | at () const noexcept(false) FORCE_INLINE |
| | Perform a range-checked selection of the requested element. More...
|
| |
| template<bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Ret = typename boost::mpl::at<mapped_types, AsType>::type> |
| constexpr Ret & | at () noexcept(false) FORCE_INLINE |
| | Perform a range-checked selection of the requested element. More...
|
| |
| template<bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Ret = typename boost::mpl::at<mapped_types, AsType>::type> |
| void | erase () noexcept(true) FORCE_INLINE |
| | Remove and delete the SelectedField element, if enabled, from the mapped_types range. More...
|
| |
| template<bitfields_tags_type SelectedField> |
| bool | find () const noexcept(true) FORCE_INLINE |
| | Find if the SelectedField is enabled in the key_type,. More...
|
| |
| template<bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Arg = typename boost::mpl::at<mapped_types, AsType>::type> |
| void | push_back (Arg const &) noexcept(false) FORCE_INLINE |
| | Enable the SelectedField in the key_type, and initialise the appropriate element in the mapped_types, if necessary,. More...
|
| |
| constexpr void | swap (bitfield_map &) noexcept(true) FORCE_INLINE |
| | Bit-wise swap the contents of the container with that of the argument. More...
|
| |
template<
bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Ret = typename boost::mpl::at<mapped_types, AsType>::type>
| void __attribute__::erase |
( |
| ) |
|
|
noexcept |
Remove and delete the SelectedField element, if enabled, from the mapped_types range.
Note: this is not a generic erase, items should only be erased from the end of the collection, otherwise undefined behaviour will result. This should really be considered a pop_back() operation, where the end iterator is manually specified. Not ideal. No compaction of the mapped_types is performed after an erase, so if holes were left, this would cause the at() operations to behave incorrectly. Algorithmic complexity: POD: O(1) otherwise O(sizeof(key_type)) Pre-condition: SelectedField is the last enabled bit in the key_type.
- See also
- push_back()
template<
bitfields_tags_type SelectedField, class AsType = typename std::integral_constant<bitfields_tags_type, SelectedField>::type, class Arg = typename boost::mpl::at<mapped_types, AsType>::type>
| void __attribute__::push_back |
( |
Arg const & |
| ) |
|
|
noexcept |
Enable the SelectedField in the key_type, and initialise the appropriate element in the mapped_types, if necessary,.
Note: This only works going from smaller to larger tags in the key_type, one must not insert in the middle, otherwise this may result in undefined behaviour. This is because of the internally-computed offsets into the range of mapped_types. Hence one must not insert randomly: it is likely that existing contents will be incorrectly overwritten, also leading to undefined behaviour. Algorithmic complexity: O(sizeof(key_type)) Post-condition: empty()==false.
- Returns
- A reference to the initialised element in the mapped_types.