The library defines a set of containers that have been specially tailored for embedded systems.
They have a maximum capacity fixed at compile time and make no calls to malloc/free or new/delete.
They are completely deterministic.
Most container types have been designed to mimic, as far as possible, those found in the STL. Some do not have
direct STL equivalents.
As the storage for all of the container types is allocated as a contiguous block, they are extremely cache friendly.
Note: In the ETL vector<bool> really is a container and actually does contains bool.
There are intrusive versions of certain containers. These do not store copies of the inserted values, but link to the
original objects. Certain types of intrusive container require that the stored object derives from an intrusive link.
Most intrusive containers do not have a maximum fixed capacity.
See here for more information.
unordered_map & unordered_multimap
unordered_set & unordered_multiset
To eliminate code bloat, most container templates utilise 'hoisting' where functionality, independent of the size
and/or type, is separated out in to base classes.
For example, vector<int, 5> and vector<int, 10> will share code from ivector<int>.
vector<int, 5>, vector<float, 7> and vector<int, 10> will all share code from vector_base.
The 'i' prefixed container types may be used as size independent pointer or reference types for all sizes of the
etl::vector<int, 5> vector1;
etl::vector<int, 10> vector2;
pvector = &vector1;
pvector = &vector2;
Move semantics and rvalue references
The containers vector, deque, list and forward_list currently support rvalue references and move semantics.
More to follow.
Differences from the STL containers
As the containers have a fixed capacity, most also implement full() and available() member functions.
Any member functions that require rvalue references are not supported.
Most of the containers allocate their storage from an internal instance of etl::pool.
Because of this the containers have a certain set of attributes that differ from the standard library.
• The storage for all containers is contiguous, thereby enhancing cache hits.
• No heap memory is used; no OS supplied memory management is required.
• Non-static containers declared locally within functions will store their contents on the stack.
• Copying or swapping a container is not a low cost action, as all of the contents will be copied (except for externally
buffered vectors which will use a simple pointer copy).
Although the containers utilise inheritance, like the STL containers, they are not intended to be used
ETL containers are not virtual (unless enabled by a compile time macro ETL_POLYMORPHIC_XXX, see Macros).