template<class BASETYPE, uint16_t COUNT>
class ItemCollection< BASETYPE, COUNT >
The ItemCollection template class allows to create a collection of arbitrary items. Using the forEach() method, a custom callback method is invoked for each item in the collection. A context is available which allows the callback's owner to pass arguments to the callback method which are specific to this forEach() invocation and thus cannot be stored statically at the caller site.
- Parameters
-
BASETYPE | Type of items to be collected. |
COUNT | Maximum number of items in the collection. |
- Note
- Due to the way the ItemCollection stores elements internally, the order of elements is hard to predict. An application designer should not make any assumptions about the order in which elements are handled using the forEach() method.
-
avr-gcc currently doesn't support std::function, and when using "normal" function pointers to catch lambda expressions you cannot use captures.
- Todo:
- This one needs thorough testing! Especially compact() and its dependencies.