Multiple document updates

This commit is contained in:
John Wellbelove 2026-05-19 12:12:14 +01:00
parent 78be6f298e
commit 003e5f3c86
113 changed files with 2470 additions and 1800 deletions

View File

@ -4,7 +4,7 @@ title: "io_port"
{{< callout type="info">}}
Header: `io_port.h`
Since: `20.39.0`
From: `20.39.0`
{{< /callout >}}
A set of templates for building interface classes to memory mapped hardware ports.

View File

@ -4,7 +4,7 @@ title: "message_bus"
{{< callout type="info">}}
Header: `message_broker.h`
Since: `20.33.0`
From: `20.33.0`
{{< /callout >}}
Message Bus

View File

@ -46,7 +46,7 @@ explicit message_packet(const TMessage&)
```
Constructs a message packet from a `TMessage` reference.
Emits a compile time static assert if the parameter is not one listed in the template parameter list.
Since: `20.22.0`
From: `20.22.0`
---
@ -56,7 +56,7 @@ explicit message_packet(TMessage&&)
```
Move constructs a message packet from a `TMessage` rvalue reference.
Emits a compile time static assert if the parameter is not one listed in the template parameter list.
Since: `20.22.0`
From: `20.22.0`
---

View File

@ -4,7 +4,7 @@ title: "message_router_registry"
{{< callout type="info">}}
Header: `message_router_registry`
Since: `20.6.0`
From: `20.6.0`
{{< /callout >}}
A class that will act as a registry for all message router types.

View File

@ -404,7 +404,7 @@ class lsb_mask;
```
Defines the member constant value as a binary value of NBits `1` shift to the LSB.
e.g. `lsb_mask<int8_t, 3>::value == 0b00000111`
Since: `20.34.0`
From: `20.34.0`
---
@ -414,7 +414,7 @@ ETL_CONSTEXPR T make_lsb_mask(size_t nbits)
```
Returns a binary value of nbits `1` shift to the LSB.
e.g. `make_lsb_mask<int8_t>(3) == 0b00000111`
Since: `20.34.0`
From: `20.34.0`
---
@ -425,7 +425,7 @@ ETL_CONSTEXPR T make_lsb_mask()
**Description**
Returns a binary value of nbits `1` shift to the LSB.
e.g. `make_lsb_mask<int8_t, 3>() == 0b00000111`
Since: `20.38.7`
From: `20.38.7`
---
@ -436,7 +436,7 @@ class msb_mask;
**Return**
A binary value of nbits `1` shift to the MSB.
e.g. `msb_mask<int8_t, 3>::value == 0b11100000`
Since: `20.34.0`
From: `20.34.0`
---
@ -458,7 +458,7 @@ ETL_CONSTEXPR T make_msb_mask()
**Description**
Defines the member constant value as a binary value of NBits `1` shift to the MSB.
e.g. `make_msb_mask<int8_t, 3>() == 0b11100000`
Since: `20.38.7`
From: `20.38.7`
## Bit manipulation functors
These functors are most useful where lambdas are not available.
@ -468,7 +468,7 @@ These functors are most useful where lambdas are not available.
template <typename T>
struct binary_not : public etl::unary_function<T, T>;
```
Since: `20.38.11`
From: `20.38.11`
---
@ -494,7 +494,7 @@ T operator(T value)
template <typename T>
struct binary_and : public etl::unary_function<T, T>;
```
Since: `20.38.11`
From: `20.38.11`
---
@ -520,7 +520,7 @@ T operator(T value)
template <typename T>
struct binary_or : public etl::unary_function<T, T>;
```
Since: `20.38.11`
From: `20.38.11`
---
@ -546,7 +546,7 @@ T operator(T value)
template <typename T>
struct binary_xor : public etl::unary_function<T, T>;
```
Since: `20.38.11`
From: `20.38.11`
---

View File

@ -4,7 +4,7 @@ title: "byte"
{{< callout type="info">}}
Header: `byte.h`
Since: `20.24.0`
From: `20.24.0`
Similar to: [std::byte](https://en.cppreference.com/cpp/types/byte)
{{< /callout >}}

View File

@ -5,7 +5,7 @@ weight: 1
{{< callout type="info">}}
Header: `inplace_function.h`
Since: `20.45.0`
From: `20.45.0`
Similar to: [std::function](https://en.cppreference.com/w/cpp/utility/functional/function.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "signal"
{{< callout type="info">}}
Header: `signal.h`
Since: `20.44.0`
From: `20.44.0`
{{< /callout >}}
A class that implements simple signal/slot framework.

View File

@ -5,6 +5,6 @@ weight: 100
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "Chrono literals"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::literals::chrono_literals](https://en.cppreference.com/w/cpp/chrono.html#Literals)
{{< /callout >}}

View File

@ -5,7 +5,7 @@ weight: 100
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "duration_cast"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::duration_cast](https://en.cppreference.com/w/cpp/chrono/duration/duration_cast.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "duration_values"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::duration_values](https://en.cppreference.com/w/cpp/chrono/duration_values.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "hh_mm_ss"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::hh_mm_ss](https://en.cppreference.com/w/cpp/chrono/hh_mm_ss.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "last_spec"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::last_spec](https://en.cppreference.com/w/cpp/chrono/last_spec.html)
{{< /callout >}}

View File

@ -5,7 +5,7 @@ weight: 100
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "month"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::month](https://en.cppreference.com/w/cpp/chrono/month.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "month_day"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::month_day](https://en.cppreference.com/w/cpp/chrono/month_day.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "month_day_last"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::month_day_last](https://en.cppreference.com/w/cpp/chrono/month_day_last.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "month_weekday"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::month_weekday](https://en.cppreference.com/w/cpp/chrono/month_weekday.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "month_weekday_last"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::month_weekday_last](https://en.cppreference.com/w/cpp/chrono/month_weekday_last.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "Operators"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::operator /](https://en.cppreference.com/w/cpp/chrono/operator_slash.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "time_point"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::time_point](https://en.cppreference.com/w/cpp/chrono/time_point.html)
{{< /callout >}}

View File

@ -5,7 +5,7 @@ weight: 100
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "weekday"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::weekday](https://en.cppreference.com/w/cpp/chrono/weekday.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "weekday_indexed"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::weekday_indexed](https://en.cppreference.com/w/cpp/chrono/weekday_last.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "weekday_last"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::weekday_last](https://en.cppreference.com/w/cpp/chrono/weekday_last.html)
{{< /callout >}}

View File

@ -5,7 +5,7 @@ weight: 100
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono](https://en.cppreference.com/w/cpp/chrono.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "year"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::year](https://en.cppreference.com/w/cpp/chrono/year.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "year_month"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::year_month](https://en.cppreference.com/w/cpp/chrono/year_month.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "year_month_day"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::year_month_day](https://en.cppreference.com/w/cpp/chrono/year_month_day.html)
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "year_month_day_last"
{{< callout type="info">}}
Header: `chrono.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: [std::chrono::year_month_day_last](https://en.cppreference.com/w/cpp/chrono/year_month_day_last.html)
{{< /callout >}}

View File

@ -7,7 +7,7 @@ title: "Base64"
`base64.h` Common definitions
`base64_encoder.h` Encoder class
`base64_decoder.h` Decoder class
Since: `20.38.4`
From: `20.38.4`
{{< /callout >}}
Encodes and decodes data to and from Base64 format.

View File

@ -0,0 +1,189 @@
---
title: "multi_span"
---
{{< callout >}}
Header: `multi_span.h`
{{< /callout >}}
This class implements a span of a range of spans.
Allows implementation of Scatter/Gather to multiple buffers or ports.
Iterating through the `multi_span` will iterate through the collection of spans consecutively.
The list of spans must be in a contiguous list, such as an array or vector.
```cpp
etl::multi_span<typename T>
```
Where `T` is the element type of the spans.
## Member types
```cpp
element_type T
value_type remove_cv<T>::type
size_type size_t
difference_type ptrdiff_t
reference value_type&
const_reference const value_type&
pointer value_type*
const_pointer const value_type*
iterator Forward iterator <20.39.5
Bidirectional iterator >=20.39.5
const_iterator Constant Forward iterator <20.39.5
Constant bidirectional iterator >=20.39.5
reverse_iterator ETL_OR_STD::reverse_iterator<iterator>
const_reverse_iterator ETL_OR_STD::reverse_iterator<const_iterator>
span_type etl::span<T>
span_list_type etl::span<const span_type>
```
## Constructors
ETL_CONSTEXPR multi_span(span_list_type span_list)
**Description**
Construct from a span of spans.
---
template <typename TContainer>
ETL_CONSTEXPR multi_span(TContainer& a) ETL_NOEXCEPT
**Description**
Construct from a container of spans.
---
template <typename TContainer>
ETL_CONSTEXPR multi_span(const TContainer& a) ETL_NOEXCEPT
**Description**
Construct from a const container of spans.
---
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin, TIterator end)
**Description**
Construct from a range of spans.
---
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin, size_t length)
**Description**
Construct from a range of spans.
---
ETL_CONSTEXPR multi_span(const multi_span& other)
**Description**
Copy constructor.
## Access
```cpp
ETL_CONSTEXPR14 multi_span& operator =(const multi_span& other) ETL_NOEXCEPT
```
**Description**
Assign from a other `multi_span`.
## Iterators
```cpp
ETL_CONSTEXPR iterator begin() const ETL_NOEXCEPT
```
**Description**
Returns an iterator to the beginning of the span.
---
```cpp
ETL_CONSTEXPR iterator end() const ETL_NOEXCEPT
```
**Description**
Returns an iterator to the end of the span.
---
```cpp
ETL_CONSTEXPR iterator cbegin() const ETL_NOEXCEPT
```
**Description**
Returns a const iterator to the beginning of the span.
From: `20.39.5`
---
```cpp
ETL_CONSTEXPR iterator cend() const ETL_NOEXCEPT
```
**Description**
Returns a const iterator to the end of the span.
From: `20.39.5`
---
```cpp
ETL_CONSTEXPR iterator rbegin() const ETL_NOEXCEPT
```
**Description**
Returns a reverse iterator to the beginning of the span.
From: `20.39.5`
---
```cpp
ETL_CONSTEXPR iterator rend() const ETL_NOEXCEPT
```
**Description**
Returns a reverse iterator to the end of the span.
From: `20.39.5`
---
```cpp
ETL_CONSTEXPR iterator crbegin() const ETL_NOEXCEPT
```
**Description**
Returns a const reverse iterator to the beginning of the span.
From: `20.39.5`
---
```cpp
ETL_CONSTEXPR iterator crend() const ETL_NOEXCEPT
```
**Description**
Returns a const reverse iterator to the end of the span.
From: `20.39.5`
## Capacity
```cpp
ETL_CONSTEXPR bool empty() const ETL_NOEXCEPT
```
**Description**
Returns true if the size of the multi_span is zero, otherwise false.
---
```cpp
ETL_CONSTEXPR size_t size() const ETL_NOEXCEPT
```
**Description**
Returns the size of the multi_span.
---
```cpp
ETL_CONSTEXPR size_t size_bytes() const ETL_NOEXCEPT
```
**Description**
Returns the size of the multi_span in bytes.
---
```cpp
ETL_CONSTEXPR size_t size_spans() const ETL_NOEXCEPT
```
**Description**
Returns the number of the spans.

View File

@ -4,7 +4,7 @@ title: "poly_span"
{{< callout >}}
Header: `poly_span.h`
Since: `20.31.0`
From: `20.31.0`
{{< /callout >}}
Polymorphic span.

View File

@ -10,7 +10,7 @@ title: "span"
This class implements a view in to a range of a C array, `etl::array`, `std::array`, `etl::vector` and `std::vector`.
It will support construction from any class that supports `data()` and `size()` member functions as well as plain C arrays.
Since: `20.34.0`
From: `20.34.0`
The ETL's span adds the ability to access circular iterators that will loop through the span when the beginning or end is reached.
```cpp
@ -263,7 +263,7 @@ ETL_NODISCARD ETL_CONSTEXPR circular_iterator begin_circular() const ETL_NOEXCEP
```
**Description**
Returns a circular iterator to the beginning of the span.
Since: `20.34.0`
From: `20.34.0`
---
@ -288,7 +288,7 @@ ETL_NODISCARD ETL_CONSTEXPR reverse_circular_iterator rbegin_circular() const E
```
**Description**
Returns a reverse circular iterator to the beginning of the span.
Since: `20.34.0`
From: `20.34.0`
---
@ -333,7 +333,7 @@ bool operator ==(const etl::span<T1, N1>& lhs, const etl::span<T2, N2>& rhs) ETL
**Description**
Compare two spans for equality.
Returns true if they both point to the same range of data.
Since: `20.35.12`
From: `20.35.12`
---
@ -346,7 +346,7 @@ bool operator !=(const etl::span<T1, N1>& lhs, const etl::span<T2, N2>& rhs) ETL
**Description**
Compare two spans for inequality.
Returns true if they don't both point to the same range of data.
Since: `20.35.12`
From: `20.35.12`
---
@ -362,7 +362,7 @@ Returns `true` if one of the following are `true`
2. They both point to the same range of data.
3. The values in the two ranges are equal.
Since: `20.35.12`
From: `20.35.12`
## Hash
There is a specialisation of etl::hash for etl::span

View File

@ -0,0 +1,6 @@
---
title: "Binary"
weight: 100
---
Binary like containers.

View File

@ -12,7 +12,7 @@ This is the new default bitset implementation, from 20.33.0 onwards.
For the older version, see [etl::bitset (legacy)]().
A fixed capacity bitset.
Has a number of extensions over std::bitset. Can be considered similar to an array of bool.
Has a number of extensions over `std::bitset`. Can be considered similar to an array of `bool`.
Internally defined buffers
```cpp

View File

@ -13,7 +13,7 @@ etl::bloom_filter<size_t Width, typename THash1, typename THash2, typename THash
A Bloom filter that supports up to three hash functions. `Thash2` & `Thash3` are optional.
The width specified is the desired width ib bits.
The width specified is the desired width in bits.
The class may use more if the underlying bitset naturally has spare capacity.
i.e. A bloom filter with a specified capacity of 195 bits will be rounded up to 200 bits as the bitset has a block size of 8.

View File

@ -113,7 +113,7 @@ Returns a reference or const reference to the last element.
void fill(value_type value)
**Description**
Fill the current size of the buffer with `value`.
Since: `20.24.0`
From: `20.24.0`
## Iterators
@ -296,7 +296,7 @@ iterator insert(const_iterator position, rvalue_reference value)
**Description**
Inserts values in to the deque. If the deque is full then emits an `etl::deque_full exception`.
Undefined behaviour if asserts or exceptions are not enabled.
Since: `20.20.0`
From: `20.20.0`
---
@ -319,7 +319,7 @@ iterator erase(const_iterator position)
**Description**
Erases values in the deque.
Undefined behaviour if asserts or exceptions are not enabled and begin, end or position are invalid.
Since: `20.20.0`
From: `20.20.0`
---
@ -352,7 +352,7 @@ iterator emplace(iterator insert_position, Args&& ... args)
---
C++03
Since: `20.20.0`
From: `20.20.0`
```cpp
template <typename T1>

View File

@ -0,0 +1,84 @@
---
title: "imemory_block_allocator"
---
{{< callout >}}
Header: `imemory_block_allocator.h`
{{< /callout >}}
The base of all memory block allocators.
Inherits from traits class `etl::successor<imemory_block_allocator>`.
Defines the functionality and interface for derived memory block allocators.
The class defines a public non-virtual interface and protected virtual overrides.
A derived class must define these overrides.
## Types
```cpp
successor_type
```
## Non-virtual public interface
```cpp
void* allocate(size_t required_size, size_t required_alignment)
```
**Description**
Attempts to allocate a memory block of the required size (in char) and alignment and return a pointer to it.
If the allocator is unable to do this and it has a successor, then the request will be passed on to it, otherwise `ETL_NULLPTR` will be returned.
---
```cpp
bool release(const void* const p)
```
**Description**
Attempts to release a memory block and returns `true` if successful.
If the allocator is unable to do this and it has a successor, then the request will be passed on to it, otherwise `false` will be returned.
---
## Virtual protected interface
```cpp
virtual void* allocate_block(size_t required_size, size_t required_alignment) = 0;
```
**Description**
The derived class must implement this function.
It will attempt to allocate a block of the required size. If it is unable to, it must return `ETL_NULLPTR`.
---
```cpp
virtual bool release_block(const void* const) = 0;
```
**Description**
The derived class must implement this function.
It will attempt to release a block. If it is unable to, it must return `false`.
---
```cpp
void set_successor(successor_type& s)
```
**Description**
Set the successor.
---
```cpp
successor_type& get_successor() const
```
**Description**
Get the successor.
---
```cpp
bool has_successor() const
```
**Description**
Returns `true` if a successor has been set.

View File

@ -2,9 +2,628 @@
title: "indirect_vector"
---
{{< callout >}}
Header: `vector.h`
Since: All versions
Similar to: [std::vectr](https://en.cppreference.com/w/cpp/container/vector.html)
{{< callout type="info">}}
Header: `indirect_vector.h`
Similar to: `std::vector`
{{< /callout >}}
A fixed capacity vector that uses indirection to access the elements.
Can be more efficient for vectors of large objects, especially when inserting, erasing or sorting.
Supplies function adaptors to allow efficient application of external algorithms.
```cpp
etl::indirect_vector<typename T, size_t SIZE>
etl::indirect_vector_ext<typename T>
```
Inherits from `etl::iindirect_vector<T>`.
`etl::iindirect_vector` may be used as a size independent pointer or reference type for any `etl::indirect_vector` instance.
## External buffer
```cpp
etl::indirect_vector_ext<typename T>
```
With this template, the constructor expects pointer and size parameters to the externally provided indirection lookup vector and pool.
## Template deduction guides
C++17 and above
```cpp
template <typename... T>
etl::indirect_vector(T...)
```
### Example
```cpp
etl::indirect_vector data{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
```
Defines data as an `indirect_vector` of `int`, of length `10`, containing the supplied data.
## Member types
```cpp
value_type T
size_type std::size_t
difference_type std::ptrdiff_t
reference value_type&
const_reference const value_type&
pointer value_type*
const_pointer const value_type*
indirect_iterator Iterator to the internal lookup vector
indirect_const_iterator Constant iterator to the internal lookup vector
const_pointer const value_type*
iterator Random access iterator
const_iterator Constant random access iterator
reverse_iterator std::reverse_iterator<iterator>
const_reverse_iterator std::reverse_iterator<const_iterator>
```
## Iterators
Both `iterator` and `const_iterator` define `indirection()` member functions that return an `indirect_iterator` or `indirect_const_iterator` to the internal lookup vector.
Access to these iterators allows an external algorithm to manipulate the `indirect_vector` without moving the objects themselves, thereby vastly increasing the efficiency for vectors of large objects.
## Function Object Adaptors
Unary and binary function object wrappers are defined to allow algorithms to manipulate the contents of an `indirect_vector` using a standard function object with indirect iterators.
```cpp
template <typename TUnaryFunction, typename TReturnType = void>
class unary_function_adaptor
```
---
```cpp
template <typename TBinaryFunction, typename TReturnType = void>
class binary_function_adaptor
```
### Example
Sorting without moving or copying large objects.
```cpp
// The large data that we are storing in the vector.
struct Data
{
std::array<int, 1000> values;
};
// How to compare Data objects.
bool operator <(const Data& lhs, const Data& rhs)
{
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
// The vector of data.
using Vector = etl::indirect_vector<Data, 10>;
Vector v;
// std::less wrapped in a binary_function_adaptor.
using LessThan = typename Vector::binary_function_adaptor<std::less<Data>, bool>;
// Sort the vector without moving or copying actual Data objects.
std::sort(v.begin().indirection(),
v.end().indirection(),
LessThan());
```
{{< callout type="warning">}}
Warning: This technique is not suitable for algorithms that may leave the container with multiple copies of an object, such as `std::remove_if`. This is because the algorithm may create multiple copies of the indirect iterator, but only one copy of the object that they point to.
{{< /callout >}}
## Constructor
### Internal buffer
```cpp
etl::indirect_vector<typename T, const size_t SIZE>()
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize)
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, const T& value)
template <typename TIterator>
etl::indirect_vector<typename T, const size_t SIZE>(TIterator begin, TIterator end)
etl::indirect_vector<typename T, const size_t SIZE>(const etl::indirect_vector<typename T, const size_t SIZE>&)
etl::indirect_vector<typename T, const size_t SIZE>(etl::indirect_vector<typename T, const size_t SIZE>&&)
```
**Description**
If the vector is full then emits an `etl::vector_full`.
If asserts or exceptions are not enabled then undefined behaviour occurs.
### External buffer
```cpp
etl::indirect_vector<typename T, const size_t SIZE>(etl::ivector<T*>& lookup, etl::ipool& storage)
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, etl::ivector<T*>& lookup, etl::ipool& storage)
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, const T& value, etl::ivector<T*>& lookup, etl::ipool& storage)
template <typename TIterator>
etl::indirect_vector<typename T, const size_t SIZE>(TIterator begin, TIterator end, etl::ivector<T*>& lookup, etl::ipool& storage)
etl::indirect_vector<typename T, const size_t SIZE>(const etl::indirect_vector<typename T, const size_t SIZE>&, etl::ivector<T*>& lookup, etl::ipool& storage)
etl::indirect_vector<typename T, const size_t SIZE>(etl::indirect_vector<typename T, const size_t SIZE>&&, etl::ivector<T*>& lookup, etl::ipool& storage)
```
**Description**
If the vector is full then emits an `etl::vector_full`.
If asserts or exceptions are not enabled then undefined behaviour occurs.
## Element access
```cpp
reference at(size_t i)
const_reference at(size_t i) const
```
**Description**
Returns a reference or const reference to the indexed element.
Emits an `etl::vector_out_of_range` if the index is out of range of the array.
If asserts or exceptions are not enabled then undefined behaviour occurs.
---
```cpp
reference operator[](size_t i)
const_reference operator[](size_t i) const
```
**Description**
Returns a reference or const reference to the indexed element.
if the index is out of range of the array then undefined behaviour occurs.
---
```cpp
reference front()
const_reference front() const
```
**Description**
Returns a reference or const reference to the first element.
Undefined behaviour if the vector is empty.
---
```cpp
reference back()
const_reference back() const
```
**Description**
Returns a reference or const reference to the last element.
Undefined behaviour if the vector is empty.
## Iterators
```cpp
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
```
**Description**
Returns an iterator to the beginning of the vector.
---
```cpp
iterator end()
const_iterator end() const
const_iterator cend() const
```
**Description**
Returns an iterator to the end of the vector.
---
```cpp
iterator rbegin()
const_reverse_iterator rbegin() const
const_reverse_iterator crbegin() const
```
**Description**
Returns a reverse iterator to the beginning of the vector.
---
```cpp
iterator rend()
const_reverse_iterator rend() const
const_reverse_iterator crend() const
```
**Description**
Returns a reverse iterator to the end of the vector.
## Capacity
```cpp
bool empty() const
```
**Description**
Returns true if the size of the vector is zero, otherwise false.
---
```cpp
bool full() const
```
**Description**
Returns true if the size of the vector is SIZE, otherwise false.
---
```cpp
size_t size() const
```
**Description**
Returns the size of the vector.
---
```cpp
void resize(size_t new_size, T value = T())
```
**Description**
Resizes the vector, up to the maximum capacity. Emits an etl::vector_full if the vector does not have the capacity.
---
```cpp
size_t max_size() const
```
**Description**
Returns the maximum possible size of the vector.
---
```cpp
size_t capacity() const
```
**Description**
Returns the maximum possible size of the vector.
---
```cpp
size_t available() const
```
**Description**
Returns the remaining available capacity in the vector.
## Modifiers
```cpp
template <typename TIterator>
void assign(TIterator begin, TIterator end)
void assign(size_t n, const T& value)
```
**Description**
Fills the vector with the values. Emits etl::vector_iterator if the distance between begin and end is illegal.
(debug mode only). If asserts or exceptions are not enabled undefined behaviour occurs.
---
```cpp
void push_back(const T& value)
void push_back(T&& value)
```
**Description**
Pushes a value to the back of the vector.
If the vector is full then emits an etl::vector_full. If asserts or exceptions are not enabled undefined behaviour occurs.
---
**C++03**
```cpp
void emplace()
void emplace(const T1& value1)
void emplace(const T1& value1, const T2& value2)
void emplace(const T1& value1, const T2& value2, const T3& value3)
void emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
Supports up to four constructor parameters.
---
**C++11**
```cpp
template <typename Args>
void emplace(Args&&… args)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
Pushes a value to the back of the vector.
If the vector is full then emits an `etl::vector_full`.
If asserts or exceptions are not enabled undefined behaviour occurs.
---
**C++03**
```cpp
void emplace_back(const T1& value1)
void emplace_back(const T1& value1, const T2& value2)
void emplace_back(const T1& value1, const T2& value2, const T3& value3)
void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
If the vector is full then emits an `etl::vector_full`. If asserts or exceptions are not enabled undefined behaviour occurs.
Supports up to four constructor parameters.
Before: `20.35.10`
---
```cpp
reference emplace_back() 20.38.0
reference emplace_back(const T1& value1)
reference emplace_back(const T1& value1, const T2& value2)
reference emplace_back(const T1& value1, const T2& value2, const T3& value3)
reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
If the vector is full then emits an `etl::vector_full`. If asserts or exceptions are not enabled undefined behaviour occurs.
Supports up to four constructor parameters.
Since: `20.35.10`
---
**C++11**
```cpp
template <typename Args...>
void emplace_back(Args&&... args)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
If the vector is full then emits an `etl::vector_full`. If asserts or exceptions are not enabled undefined behaviour occurs.
Before: `20.35.10`
---
```cpp
template <typename Args...>
reference emplace_back(Args&&... args)
```
**Description**
Constructs an item at the back of the the vector 'in place'.
Supports up to four constructor parameters.
If the vector is full then emits an `etl::vector_full`. If asserts or exceptions are not enabled undefined behaviour occurs.
Since: `20.35.10`
---
```cpp
void pop_back()
```
**Description**
Pop a value from the back of the vector.
If the vector is empty and `ETL_CHECK_PUSH_POP` is defined then emits an `etl::vector_empty`.
If asserts or exceptions are not enabled undefined behaviour occurs.
---
```cpp
template <typename TIterator>
void insert(iterator position, TIterator begin, TIterator end)
```
**Description**
Insert the range [`begin`, `end`) at `position`.
Before: `20.19.0`
---
```cpp
template <typename TIterator>
iterator insert(const_iterator position, TIterator begin, TIterator end)
```
**Description**
Insert the range [`begin`, `end`) at `position`.
Since: `20.20.0`
**Return**
`position`
---
```cpp
iterator insert(iterator position, const T& value)
iterator insert(iterator position, T&& value)
```
**Description**
Insert `value` at `position`.
**Return**
`position`
---
```cpp
iterator insert(const_iterator position, const T& value)
iterator insert(const_iterator position, T&& value)
```
**Description**
Insert `value` at `position`.
**Return**
`position`
---
```cpp
void insert(iterator position, size_t n, const T& value)
```
**Description**
Inserts `n` copies of `value` at `position`.
---
```cpp
iterator insert(const_iterator position, size_t n, const T& value)
```
**Description**
Inserts values in to the vector.
If the vector is full then emits an `etl::vector_full` exception. If asserts or exceptions are not enabled undefined behaviour occurs.
---
```cpp
template <typename TIterator>
iterator erase(TIterator begin, TIterator end)
```
**Description**
Erase elements in the range [`begin`, `end`).
**Return**
An iterator to the element after the erased range.
---
<=20.19.0
```cpp
iterator erase(iterator position)
```
**Description**
Erases values in the vector.
Iterators are not checked.
Before: `20.20.0`
---
```cpp
iterator erase(iterator position)
iterator erase(const_iterator position)
```
**Description**
Erases values in the vector.
Iterators are not checked.
Since: `20.20.0`
**Return**
An iterator to the element after the erased element.
---
```cpp
void clear()
```
**Description**
Clears the vector to a size of zero.
---
```cpp
void sort()
```
**Description**
Sorts the elements using the 'less than' operator.
---
```cpp
template <typename TCompare>
void sort(TCompare compare)
```
**Description**
Sorts the elements using the supplied compare.
---
```cpp
void sort(iterator first, iterator last)
```
**Description**
Sorts a range of elements using the supplied 'less than' operator.
---
```cpp
template <typename TCompare>
void sort(iterator first, iterator last, TCompare compare)
```
**Description**
Sorts a range of elements using the supplied `compare`.
---
```cpp
void stable_sort()
```
**Description**
Stable sorts the elements using the 'less than' operator.
---
```cpp
template <typename TCompare>
void stable_sort(TCompare compare)
```
**Description**
Stable sorts the elements using the supplied compare.
---
```cpp
void stable_sort(iterator first, iterator last)
```
**Description**
Stable sorts a range of elements using the supplied 'less than' operator.
---
```cpp
template <typename TCompare>
void stable_sort(iterator first, iterator last, TCompare compare)
```
**Description**
Stable sorts a range of elements using the supplied compare.
## Non-member functions
```cpp
operator ==
```
**Description**
`true` if the contents of the vectors are equal, otherwise `false`.
---
```cpp
operator !=
```
**Description**
`true` if the contents of the vectors are not equal, otherwise `false`.
---
```cpp
operator <
```
**Description**
`true` if the contents of the lhs are lexicographically less than the contents of the rhs, otherwise `false`.
---
```cpp
operator <=
```
**Description**
`true` if the contents of the lhs are lexicographically less than or equal to the contents of the rhs, otherwise `false`.
---
```cpp
operator >
```
**Description**
`true` if the contents of the lhs are lexicographically greater than the contents of the rhs, otherwise `false`.
---
```cpp
operator >=
```
**Description**
`true` if the contents of the lhs are lexicographically greater than or equal to the contents of the rhs, otherwise `false`.

View File

@ -0,0 +1,345 @@
---
title: "intrusive_list"
---
{{< callout type="info">}}
Header: `intrusive_list.h`
Similar to: `std::list`
{{< /callout >}}
An intrusive list.
```cpp
template <typename TValue, typename TLink>
etl::intrusive_list
```
`TValue` is the type that contains the actual values. It is derived from `Tlink`. `Tlink` is the link type for this list.
See Intrusive links.
Before `20.37.0` the default link type was `etl::bidirectional_link<0>`.
## Member types
```cpp
link_type TLink
value_type TValue
pointer value_type*
const_pointer const value_type*
reference value_type&
const_reference const value_type&
size_type size_t
```
## Constructors
```cpp
etl::intrusive_list<typename TValue, typename TLink>()
```
---
```cpp
template <typename TIterator>
etl::intrusive_list<typename TValue, typename TLink>(TIterator begin, TIterator end)
```
**Description**
Default constructor.
---
```cpp
template <typename... TLinks>
intrusive_list(TLink& first, TLinks&... links))
```
**Description**
Creates the list from node link references.
## Element access
```cpp
TValue& front()
const T& front() const
```
**Description**
Returns a reference or const reference to the first element.
---
```cpp
TValue& back()
const T& back() const
```
**Description**
Returns a reference or const reference to the last element.
## Iterators
```cpp
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
```
**Description**
Returns an iterator to the beginning of the list.
---
```cpp
iterator end()
const_iterator end() const
const_iterator cend() const
```
**Description**
Returns an iterator to the end of the list.
---
```cpp
iterator rbegin()
const_iterator rbegin() const
const_iterator crbegin() const
```
**Description**
Returns a reverse iterator to the beginning of the list.
---
```cpp
iterator rend()
const_iterator rend() const
const_iterator crend() const
```
**Description**
Returns a reverse iterator to the end of the list.
## Capacity
```cpp
bool empty() const
```
**Description**
Returns `true` if the size of the list is zero, otherwise `false`.
---
```cpp
size_t size() const
```
**Description**
Returns the size of the list.
## Modifiers
```cpp
template <typename TIterator>
void assign(TIterator begin, TIterator end))
```
**Description**
Fills the list with the values.
---
```cpp
void push_front(value_type& value))
```
**Description**
Pushes a value to the front of the list.
---
```cpp
void push_back(value_type& value))
```
**Description**
Pushes a value to the back of the list.
---
```cpp
void pop_front())
```
**Description**
Pop a value from the front of the list.
Emits an `etl::intrusive_list_empty` if the list is empty.
If asserts or exceptions are disabled then undefined behaviour occurs.
---
```cpp
void pop_back())
```
**Description**
Pop a value from the back of the list.
Emits an `etl::intrusive_list_empty` if the list is empty.
If asserts or exceptions are disabled then undefined behaviour occurs.
---
```cpp
template <typename TIterator>
void insert(iterator position, TIterator begin, TIterator end))
```
**Description**
---
```cpp
iterator insert(iterator position, value_type& value))
```
**Description**
Inserts values in to the list.
position is not checked for validity.
---
```cpp
template <typename TIterator>
iterator erase(TIterator begin, TIterator end))
```
**Description**
Erases the range [`begin`, `end`).
---
```cpp
iterator erase(iterator position))
```
**Description**
Erases values in the list.
Iterators are not checked for validity.
---
```cpp
void clear())
```
**Description**
Clears the list to a size of zero. No elements are destructed.
---
```cpp
void splice(iterator position, list_type& list))
void splice(iterator position, list_type& list, iterator isource))
void splice(iterator position, list_type& list, iterator begin_, iterator end_))
```
**Description**
Splices elements from a list into this list.
Iterators are not checked for validity.
---
```cpp
void merge(list_type& list))
```
**Description**
Merges the sorted elements of 'list' into this list. Merges are stable.
If a debug compile and asserts or exceptions are enabled than an etl::intrusive_list_unsorted is emitted if either list is unsorted, otherwise undefined behaviour occurs.
---
```cpp
template <typename TCompare>
void merge(list_type& list, Tcompare compare))
```
**Description**
Merges the sorted elements of list into this list. Comparison functor is supplied in compare. Merges are stable.
If a debug compile and asserts or exceptions are enabled than an etl::intrusive_list_unsorted is emitted if either list is unsorted, otherwise undefined behaviour occurs.
## Operations
```cpp
void remove(const T& value))
```
**Description**
Removes from the container all the elements that compare equal to value.
---
```cpp
template <typename TPredicate>
void remove_if(TPredicate predicate))
```
**Description**
Removes from the container all the elements that satisfy predicate.
---
```cpp
void unique())
```
**Description**
Removes all but the first element from every group of consecutive elements.
---
```cpp
template <typename TPredicate>
void unique(TPredicate predicate))
```
**Description**
Removes all but the first element from every group of consecutive elements that satisfy the binary predicate.
---
```cpp
void sort())
```
**Description**
Sorts using the `<` operator.
---
```cpp
template <typename TCompare>
void sort(TCompare compare))
```
**Description**
Uses the supplied `compare` function.
---
```cpp
void reverse())
```
**Description**
Reverses the order of the list.
## Non-member functions
```cpp
operator ==
```
**Description**
`true` if the contents of the lists are equal, otherwise `false`.
```cpp
operator !=
```
**Description**
`true` if the contents of the lists are not equal, otherwise `false`.
```cpp
operator <
```
**Description**
`true` if the contents of the lhs are lexicographically less than the contents of the rhs, otherwise `false`.
```cpp
operator <=
```
**Description**
`true` if the contents of the lhs are lexicographically less than or equal to the contents of the rhs, otherwise `false`.
```cpp
operator >
```
**Description**
`true` if the contents of the lhs are lexicographically greater than the contents of the rhs, otherwise `false`.
```cpp
operator >=
```
**Description**
`true` if the contents of the lhs are lexicographically greater than or equal to the contents of the rhs, otherwise `false`.

View File

@ -308,7 +308,7 @@ reference emplace_front(const T1& value1)
```
**Description**
Emplaces a value at the front, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -328,7 +328,7 @@ reference emplace_front(const T1& value1, const T2& value2)
```
**Description**
Emplaces a value at the front, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -350,7 +350,7 @@ reference emplace_front(const T1& value1, const T2& value2,
```
**Description**
Emplaces a value at the front, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -361,7 +361,7 @@ reference emplace_front(const T1& value1, const T2& value2,
```
**Description**
Emplaces a value at the front, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -413,7 +413,7 @@ reference emplace_back(const T1& value1)
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -434,7 +434,7 @@ reference emplace_back(const T1& value1, const T2& value2)
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -456,7 +456,7 @@ reference emplace_back(const T1& value1, const T2& value2,
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -478,7 +478,7 @@ reference emplace_back(const T1& value1, const T2& value2,
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -489,7 +489,7 @@ reference emplace_back(Args&& ... args)
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -500,7 +500,7 @@ reference emplace_back(Args&& ... args)
```
**Description**
Emplaces a value at the back, constructed using the supplied arguments.
Since: `20.35.10`
From: `20.35.10`
---
@ -583,7 +583,7 @@ void emplace(iterator position, const T1& value1, const T2& value2, const T3& va
iterator emplace(const_iterator position, const T1& value1)
```
**Description**
Since: `20.20.0`
From: `20.20.0`
---
@ -622,7 +622,7 @@ void emplace(const_iterator position, Args&& ... args)
```
**Description**
Constructs an item at the insert point in the the list 'in place'.
Since: `20.20.0`
From: `20.20.0`
---

View File

@ -35,11 +35,13 @@ Defines data as an `flat_map` of `int`/`int` pairs, of length 4, containing the
## make_flat_map
C++11 and above
```cpp
template <typename TKey,
typename TMapped,
typename TKeyCompare = etl::less<TKey>,
typename... TPairs>
constexpr auto make_flat_map(TValues&&... values)
```
### Example
```cpp
@ -107,8 +109,8 @@ Construct from the range [`begin`, `end`).
## Element access
```cpp
TMapped& at(key_parameter_t key)
const TMapped& at(key_parameter_t key) const
TMapped& at(const_key_reference key)
const TMapped& at(const_key_reference key) const
```
**Description**
Returns a reference or const reference to the indexed element.
@ -118,8 +120,8 @@ If asserts or exceptions are not enabled then undefined behaviour occurs.
---
```cpp
TMapped& operator[](key_parameter_t key)
const TMapped& operator[](key_parameter_t key) const
TMapped& operator[](const_key_reference key)
const TMapped& operator[](const_key_reference key) const
```
**Description**
Returns a reference or const reference to the indexed element.
@ -255,7 +257,7 @@ template <typename T1>
pair<iterator, bool> emplace(const key_type& key, const T1& value1)
```
**Description**
Emplaces a value consructed from `key` and 1 argument into the map.
Emplaces a value constructed from `key` and 1 argument into the map.
```cpp
template <typename T1, typename T2>
@ -278,6 +280,8 @@ pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& va
**Description**
Emplaces a value constructed from `key` and 4 arguments into the map.
---
**C++11**
```cpp
template <typename ... Args>
@ -304,7 +308,7 @@ iterator erase(const_iteratorfirst, const_iteratorlast)
```
**Description**
Erase elements from the map.
Since: `20.20.0`
From: `20.20.0`
---
@ -316,7 +320,7 @@ size_t erase(K&& key)
Erases values in the map.
Returns an iterator to the next element in the map.
Iterator parameters are not checked for validity.
Since: `20.21.0`
From: `20.21.0`
---
@ -371,7 +375,7 @@ iterator find(const K& key)
**Description**
Searches for an element with the key `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
```cpp
@ -381,7 +385,7 @@ const_iterator find(const K& key) const
**Description**
Searches for an element with the key `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
---
@ -393,7 +397,7 @@ iterator lower_bound(const K& key)
**Description**
Searches for an element with the key not less than `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
```cpp
@ -403,7 +407,7 @@ const_iterator lower_bound(const K& key) const
**Description**
Searches for an element with the key not less than `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
---
@ -415,7 +419,7 @@ iterator upper_bound(const K& key)
**Description**
Searches for an element with the key greater than `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
```cpp
@ -425,13 +429,11 @@ const_iterator upper_bound(const K& key) const
**Description**
Searches for an element with the key greater than `key`.
Returns an iterator to the element, or `end()` if not found.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
---
20.21.0
C++11 or above
```cpp
template <typename K>
pair<iterator, iterator> equal_range(const K& key)
@ -439,7 +441,7 @@ pair<iterator, iterator> equal_range(const K& key)
**Description**
Returns the range of elements with a key equal to `key`.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
Since: `20.21.0`
From: `20.21.0`
Since: C++11
```cpp
@ -449,7 +451,7 @@ pair<const_iterator, const_iterator> equal_range(const K& key) const
**Description**
Returns the range of elements with a key equal to `key`.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
Since: `20.21.0`
From: `20.21.0`
Since: C++11
---
@ -458,7 +460,7 @@ Since: C++11
bool contains(key_value_parameter_t key) const
```
Check if the container contains the key.
Since: `20.21.0`
From: `20.21.0`
---
@ -469,7 +471,7 @@ bool contains(const K& k) const
```
Check if the container contains the key.
For comparators that define `is_transparent`.
Since: `20.21.0`
From: `20.21.0`
Since: C++11
## Non-member functions

View File

@ -0,0 +1,30 @@
---
title: "multi_vector"
---
A fixed capacity multi-dimensional vector.
For C++11 or greater only.
```cpp
etl::multi_vector<typename T, const size_t Dx...>
```
## Description
The `etl::multi_vector` class is defined as a recursive variadic template.
It defines a multi-dimensional array class based on nested `etl::vector` definitions.
## Example
```cpp
etl::multi_vector<int, 2, 3, 4>
```
is equivalent to
```cpp
etl::vector<etl::vector<etl::vector<int, 4>, 3>, 2>
```
Each dimension of an `etl::multi_vector` supports all of the members of an `etl::vector`.

View File

@ -97,7 +97,7 @@ bool is_valid() const
**Description**
Returns `true` if the buffer has been set through the constructor or `set_buffer`.
For circular_buffer_ext only.
Since: `20.32.1`
From: `20.32.1`
## Element access
@ -133,7 +133,7 @@ void fill(value_type value)
```
**Description**
Fill the current size of the buffer with `value`.
Since: `20.24.0`
From: `20.24.0`
## Iterators
@ -231,7 +231,7 @@ void set_buffer(void* buffer)
**Description**
Sets the associated buffer.
For circular_buffer_ext only.
Since: `20.32.1`
From: `20.32.1`
---

View File

@ -0,0 +1,6 @@
---
title: "Sets"
weight: 100
---
Set like containers.

View File

@ -0,0 +1,494 @@
---
title: "flat_set"
---
{{< callout type="info">}}
Header: `flat_set.h`
Similar to: `std::set`
{{< /callout >}}
A fixed capacity set based on a sorted vector.
The container is an associative lookup table with O(N) insertion and erase, and O(log N) search.
This container is best used for tables that are occasionally updated and spend most of their time being searched.
Uses `etl::less` as the default key comparison method.
```cpp
etl::flat_set<typename T, size_t SIZE, TKeyCompare = etl::less>
```
Inherits from `etl::iflat_set<T, TKeyCompare>`.
`etl::iflat_set` may be used as a size independent pointer or reference type for any `etl::flat_set` instance.
## Template deduction guides
C++17 and above
```cpp
template <typename... T>
etl::flat_set(T...)
```
### Example
```cpp
etl::flat_set data{ 0, 1, 2, 3 };
```
Defines data as an `flat_set` of `int`, of length 4, containing the supplied data.
## make_flat_set
C++11 and above
```cpp
template <typename T,
typename TKeyCompare = etl::less<T>>
constexpr auto make_flat_set(TValues&&... values)
```
### Example
```cpp
auto data = etl::make_flat_set<int>({0, 1, 2, 3 });
```
## Member types
```cpp
key_type T
value_type T
size_type std::size_t
difference_type std::ptrdiff_t
reference reference
const_reference const_reference
rvalue_reference reference&
pointer T*
const_pointer const T*
iterator Random access iterator
const_iterator Constant random access iterator
reverse_iterator reverse_iterator<iterator>
const_reverse_iterator reverse_iterator<const_iterator>
```
## Static Constants
`MAX_SIZE` The maximum size of the flat set.
## Constructors
```cpp
etl::flat_set<Tkey, SIZE, TKeyCompare>()
```
**Description**
Default constructor.
---
```cpp
etl::flat_set(const flat_set& other)
```
**Description**
Copy constructor.
---
```cpp
etl::flat_set(flat_set&& other)
```
**Description**
Move constructor.
---
```cpp
template <typename TIterator>
etl::flat_set<Tkey, SIZE, TKeyCompare>(TIterator begin, TIterator end);
```
**Description**
Construct from the range [`begin`, `end`).
## Element access
```cpp
reference at(const_reference key)
const_reference at(const_reference key) const
```
**Description**
Returns a reference or const reference to the indexed element.
Emits an `etl::flat_set_out_of_range` if the key is not in the table.
If asserts or exceptions are not enabled then undefined behaviour occurs.
---
```cpp
reference operator[](const_reference key)
const_reference operator[](const_reference key) const
```
**Description**
Returns a reference or const reference to the indexed element.
If the key is not in the table then a new entry is created.
## Iterators
```cpp
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
```
**Description**
Returns an iterator to the beginning of the set.
---
```cpp
iterator end()
const_iterator end() const
const_iterator cend() const
```
**Description**
Returns an iterator to the end of the set.
---
```cpp
iterator rbegin()
const_iterator rbegin() const
const_iterator crbegin() const
```
**Description**
Returns a reverse iterator to the beginning of the set.
---
```cpp
iterator rend()
const_iterator rend() const
const_iterator crend() const
```
**Description**
Returns a reverse iterator to the end of the set.
## Capacity
```cpp
bool empty() const
```
**Description**
Returns `true` if the size of the set is zero, otherwise `false`.
---
```cpp
bool full() const
```
**Description**
Returns `true` if the size of the lookup is `SIZE`, otherwise `false`.
---
```cpp
size_t size() const
```
**Description**
Returns the size of the lookup.
---
```cpp
size_t max_size() const
```
**Description**
Returns the maximum possible size of the set.
---
```cpp
size_t available() const
```
**Description**
Returns the remaining available capacity in the set.
## Modifiers
```cpp
flat_set& operator = (const flat_set& rhs)
flat_set& operator = (flat_set&& rhs)
```
**Description**
Copies or moves the data from another flat set.
---
```cpp
pair<iterator, bool> insert(const_reference value)
pair<iterator, bool> insert(rvalue_reference value)
iterator insert(iterator position, const_reference value)
iterator insert(iterator position, rvalue_reference value)
```
**Description**
Inserts a value into the set.
```cpp
template <typename TIterator>
void insert(TIterator first, TIterator last)
```
**Description**
Inserts values in to the set.
If the set is full then emits an `etl::flat_set_full`. If asserts or exceptions are not enabled then undefined behaviour occurs.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
---
```cpp
pair<iterator, bool> emplace((const_reference value))
pair<iterator, bool> emplace(const key_type& key, const mapped_type& value)
```
**Description**
Inserts key/value pairs into the set by constructing directly into storage.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
---
**C++03**
The emplace functions differ from that of std::set in that, due to C++03 not supporting 'perfect forwarding'.
```cpp
template <typename T1>
pair<iterator, bool> emplace(const key_type& key, const T1& value1)
```
**Description**
Emplaces a value constructed from `key` and 1 argument into the set.
```cpp
template <typename T1, typename T2>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2)
```
**Description**
Emplaces a value constructed from `key` and 2 arguments into the set.
```cpp
template <typename T1, typename T2, typename T3>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3)
```
**Description**
Emplaces a value constructed from `key` and 3 arguments into the set.
```cpp
template <typename T1, typename T2, typename T3, typename T4>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3, const T4& value4)
```
**Description**
Emplaces a value constructed from `key` and 4 arguments into the set.
---
**C++11**
```cpp
template <typename ... Args>
pair<iterator, bool> emplace(const key_type& key, Args&& ... args)
```
**Description**
Emplaces a value constructed from the `key` and arguments into the set.
---
```cpp
size_t erase(key_value_parameter_t key)
void erase(iterator i_element)
void erase(iterator first, iterator last)
```
**Description**
Erase elements from the set.
---
```cpp
iterator erase(const_iterator i_element)
iterator erase(const_iteratorfirst, const_iteratorlast)
```
**Description**
Erase elements from the set.
From: `20.20.0`
---
```cpp
template <typename K>
size_t erase(K&& key)
```
**Description**
Erases values in the set.
Returns an iterator to the next element in the set.
Iterator parameters are not checked for validity.
From: `20.21.0`
---
```cpp
void clear();
```
**Description**
Clears the set to a size of zero.
## Search
```cpp
iterator find(key_value_parameter_t key)
const_iterator find(key_value_parameter_t key) const
```
**Description**
Searches for an element with the key `key`.
Returns an iterator to the element, or `end()` if not found.
```cpp
iterator lower_bound(key_value_parameter_t key)
const_iterator lower_bound(key_value_parameter_t key) const
```
**Description**
Searches for an element with the key not less than `key`.
Returns an iterator to the element, or `end()` if not found.
```cpp
iterator upper_bound(key_value_parameter_t key)
const_iterator upper_bound(key_value_parameter_t key) const
```
**Description**
Searches for an element with the key greater than `key`.
Returns an iterator to the element, or `end()` if not found.
```cpp
pair<iterator, iterator> equal_range(key_value_parameter_t key)
pair<const_iterator, const_iterator> equal_range(key_value_parameter_t key) const
```
**Description**
Returns the range of elements with a key equal to `key`.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
---
**For comparators that define is_transparent.**
```cpp
template <typename K>
iterator find(const K& key)
```
**Description**
Searches for an element with the key `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
```cpp
template <typename K>
const_iterator find(const K& key) const
```
**Description**
Searches for an element with the key `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
---
```cpp
template <typename K>
iterator lower_bound(const K& key)
```
**Description**
Searches for an element with the key not less than `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
```cpp
template <typename K>
const_iterator lower_bound(const K& key) const
```
**Description**
Searches for an element with the key not less than `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
---
```cpp
template <typename K>
iterator upper_bound(const K& key)
```
**Description**
Searches for an element with the key greater than `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
```cpp
template <typename K>
const_iterator upper_bound(const K& key) const
```
**Description**
Searches for an element with the key greater than `key`.
Returns an iterator to the element, or `end()` if not found.
From: `20.21.0`
Since: C++11
---
```cpp
template <typename K>
pair<iterator, iterator> equal_range(const K& key)
```
**Description**
Returns the range of elements with a key equal to `key`.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
From: `20.21.0`
Since: C++11
```cpp
template <typename K>
pair<const_iterator, const_iterator> equal_range(const K& key) const
```
**Description**
Returns the range of elements with a key equal to `key`.
The return type is either `std::pair` (default) or `etl::pair` (`ETL_NO_STL`)
From: `20.21.0`
Since: C++11
---
```cpp
bool contains(key_value_parameter_t key) const
```
Check if the container contains the key.
From: `20.21.0`
---
```cpp
template <typename K>
bool contains(const K& k) const
```
Check if the container contains the key.
For comparators that define `is_transparent`.
From: `20.21.0`
Since: C++11
## Non-member functions
**Lexicographically comparisons**
```cpp
operator ==
```
`true` if the contents of the maps are equal, otherwise `false`.
---
```cpp
operator !=
```
`true` if the contents of the maps are not equal, otherwise `false`.
## Technical stuff
Flat maps are usually implemented internally as a sorted vector of key/value pairs. Whilst this makes searching fast, it can have a detrimental effect when items are inserted into a container that stores complex, non-trivial keys or values.
As inserting requires that all of the items to the right of the insert position must be shifted this can become an expensive operation for larger containers.
To improve insertion performance ETL flat maps are implemented as vectors of pointers to key/value pairs, sorted by key value. An insertion will involve a copy of a range of pointers; an operation that can be very fast.
The downside is that access to an item via an iterator will involve one indirection and the overhead of the container will be one pointer per item. A normal flat set implementation does not have this overhead.

View File

@ -212,7 +212,7 @@ Emits an `etl::vector_full` if the vector does not have the capacity.
void uninitialized_resize(size_t new_size)
```
Resizes the vector, up to the maximum capacity, without initialising the new elements.
Since: `20.4.0`
From: `20.4.0`
---
@ -260,7 +260,7 @@ If the vector is full then emits an `etl::vector_full`. If asserts or exceptions
---
**C++03**
Since: `20.38.0`
From: `20.38.0`
```cpp
void emplace();
void emplace(const T1& value1)
@ -290,7 +290,7 @@ void emplace_back(const T1& value1, const T2& value2, const T3& value3)
void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
```
Since: `20.35.10`
From: `20.35.10`
```cpp
reference emplace_back(); 20.38.0
reference emplace_back(const T1& value1)
@ -306,7 +306,7 @@ template <typename Args...>
void emplace_back(Args&&... args)
```
Since: `20.35.10`
From: `20.35.10`
```cpp
template <typename Args...>
reference emplace_back(Args&&... args)
@ -338,7 +338,7 @@ iterator insert(iterator position, T&& value)
void insert(iterator position, size_t n, const T& value)
```
Since: `20.20.0`
From: `20.20.0`
```cpp
template <typename TIterator>
iterator insert(const_iterator position, TIterator begin, TIterator end)
@ -378,7 +378,7 @@ Clears the vector to a size of zero.
void fill(value_type value)
```
Fill the current size of the buffer with `value`.
Since: `20.24.0`
From: `20.24.0`
---

View File

@ -3,7 +3,7 @@ title: "Enabling compiler built-ins"
weight: 7
---
Since: `20.24.0`
From: `20.24.0`
Many of the features or options in the ETL can be enhanced by the use of compiler built-ins.
If built-ins are available and the STL is not used, then many copy type algorithms may be declared as `constexpr`.

View File

@ -4,7 +4,7 @@ title: "circular_iterator"
{{< callout type="info">}}
Header: `circular_iterator.h`
Since: `20.34.0`
From: `20.34.0`
{{< /callout >}}
An iterator wrapper where increments and decrements will roll around the boundaries of an iterator range.

View File

@ -4,7 +4,7 @@ title: "Invert"
{{< callout type="info">}}
Header: `invert.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Invert an input range.

View File

@ -4,7 +4,7 @@ title: "Correlation"
{{< callout type="info">}}
Header: `correlation.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Calculates the correlation of two sets of data.

View File

@ -4,7 +4,7 @@ title: "Covariance"
{{< callout type="info">}}
Header: `covariance.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
```cpp

View File

@ -4,7 +4,7 @@ title: "Gamma"
{{< callout type="info">}}
Header: `gamma.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
There are two gamma functors, `gamma_encode` and `gamma_decode`.

View File

@ -4,7 +4,7 @@ title: "Histgram"
{{< callout type="info">}}
Header: `histogram.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
## Member types

View File

@ -4,7 +4,7 @@ title: "limiter"
{{< callout type="info">}}
Header: `limiter.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Limits an input range.

View File

@ -4,7 +4,7 @@ title: "mean"
{{< callout type="info">}}
Header: `mean.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
```cpp

View File

@ -4,7 +4,7 @@ title: "quantize"
{{< callout type="info">}}
Header: `quantize.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Quantizes an input range.

View File

@ -4,7 +4,7 @@ title: "rescale"
{{< callout type="info">}}
Header: `rescale.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Rescales an input range.

View File

@ -4,7 +4,7 @@ title: "RMS (Root Mean Square)"
{{< callout type="info">}}
Header: `rms.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
```cpp

View File

@ -4,7 +4,7 @@ title: "Rounded integral division"
{{< callout type="info">}}
Header: `rounded_integral_division.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
Rounded division algorithms for integral values.

View File

@ -4,7 +4,7 @@ title: "standard_deviation"
{{< callout type="info">}}
Header: `standard_deviation.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
```cpp

View File

@ -4,7 +4,7 @@ title: "threshold"
{{< callout type="info">}}
Header: `threshold.h`
Since: `20.9.0`
From: `20.9.0`
{{< /callout >}}
```cpp

View File

@ -4,7 +4,7 @@ title: "overload"
{{< callout type="info">}}
Header: `overload.h`
Since: `20.14.0`
From: `20.14.0`
{{< /callout >}}
**For C++17 and above**

View File

@ -61,7 +61,7 @@ class visitor;
## is_visitor
Detects whether a type is a visitor.
Since: `20.37.0`.
From: `20.37.0`.
```cpp
template <typename T>
@ -137,7 +137,7 @@ triangle.accept(visitor); // visitor's visit(const Triangle&) is called.
---
Since: `20.37.0`
From: `20.37.0`
Arguments are passed according to the template parameters.
```cpp

View File

@ -1,174 +0,0 @@
---
title: "queue_lockable"
---
This class is designed to be an alternative to `etl::queue_spsc_locked`.
It is an abstract class and requires that the user derives their own type from it.
The derived class must override the two pure virtual functions `void lock() const` and `void unlock() const` to implement the required locking functionality, whether this be a mutex, ISR control or something else.
They must perform the requisite memory barriers to preserve the order of execution.
Many functions have two versions. One locks and unlocks access and is used from the foreground task. The other, with a `_from_unlocked` suffix, are called from the background task.
```cpp
etl::queue_lockable<typename T,
const size_t VSize,
const size_t VMemory_Model = etl::memory_model::MEMORY_MODEL_LARGE>
```
Inherits from `etl::iqueue_lockable<T, const size_t VMemory_Model>`.
`etl::iqueue_lockable` may be used as a size independent pointer or reference type for any `etl::queue_lockable` instance of the same implementation.
The memory model determines the type used internally for indexes and size, to allow for the most efficient implementation for the application.
## Maximum queue sizes
```cpp
MEMORY_MODEL_SMALL 255
MEMORY_MODEL_MEDIUM 65535
MEMORY_MODEL_LARGE 2147483647
MEMORY_MODEL_HUGE 9223372036854775807
```
See memory_model.h
## Member types
value_type T
size_type <based on memory model>
pointer value_type*
const_pointer const value_type*
reference value_type&
const_reference const value_type&
## Constructor
queue_lockable();
## Capacity
bool empty() const
bool empty_from_unlocked() const
Returns true if the size of the queue is zero, otherwise false.
---
bool full() const
bool full_from_unlocked() const
Returns true if the size of the queue is SIZE, otherwise false.
---
size_type size() const
size_type size_from_unlocked() const
Returns the size of the queue.
---
size_type available() const
size_type available_from_unlocked() const
Returns the remaining available capacity in the queue.
---
size_type max_size() const
Returns the maximum possible size of the queue.
---
size_type capacity() const
Returns the maximum possible size of the queue.
## Modifiers
bool push(const T& value);
bool push(T&& value);
bool push_from_unlocked(const T& value);
bool push_from_unlocked(T&& value);
Pushes a value to the back of the queue.
Returns true if successful, otherwise false.
---
bool pop();
bool pop_from_unlocked();
Pop a value from the front of the list.
Returns true if successful, otherwise false.
---
bool pop(T& value);
bool pop_from_unlocked(T& value);
Pop a value from the front of the list and place it in value.
Returns true if successful, otherwise false.
---
void clear();
void clear_from_unlocked();
Clears the queue to a size of zero.
---
### C++03
```cpp
bool emplace(const T1& value1);
bool emplace(const T1& value1, const T2& value2);
bool emplace(const T1& value1, const T2& value2, const T3& value3);
bool emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4);
```
### C++11
```cpp
bool emplace(Args&&… args);
```
Constructs an item in the the queue 'in place'.
C++03: Supports up to four constructor parameters.
## Notes
Remember that interrupts may occur between calls to the access protected functions. For example, a call to `empty()` may return `true`, but a subsequent call to `pop()` may succeed if an interrupt occurred between the two and pushed a new value.
## Example
```cpp
class InterruptControl
{
public:
void lock()
{
// Store current interrupt control register and disable the relevant interrupt.
}
void unlock()
{
// Restore the interrupt control register.
}
};
InterruptControl interruptControl;
// Create function wrappers with direct calls to the instance's member functions.
etl::function_imv<InterruptControl, interruptControl, &InterruptControl::lock> lock;
etl::function_imv<InterruptControl, interruptControl, &InterruptControl::unlock> unlock;
etl::queue_spsc_locked<char, 10> queue(lock, unlock);
int main()
{
while (true)
{
char c;
if (queue.pop(c))
{
Print(c);
}
}
}
void ISR(char c)
{
queue.push_from_unlocked(c);
}
```

View File

@ -1,279 +0,0 @@
Intrusive Links
A set of link structures designed to be used within containers such as etl::intrusive_list.
They are parameterised by an id that allows them to be multiply inherited from when creating objects that must exist in more than one intrusive container.
There are link and unlink functions supplied to manage connections between links. The functions will accept any permutation of pointer and reference parameters, though reference parameters offer the best performance.
For bidirectional links, unlinking a node will automatically adjust the links of the surrounding nodes at the same level.
____________________________________________________________________________________________________
Forward link
template <size_t ID_>
struct forward_link
____________________________________________________________________________________________________
Template parameters
const size_t ID_ A unique id for this link level.
____________________________________________________________________________________________________
Public constants
enum ID The unique id for this link level.
____________________________________________________________________________________________________
Public variables
forward_link<ID>* etl_next A pointer to the next forward link at this level.
____________________________________________________________________________________________________
Public functions
clear() Clears the pointers to nullptr.
____________________________________________________________________________________________________
Link functions
template <typename TLink>
struct is_forward_link
template <typename TLink>
inline constexpr bool is_forward_link_v;
C++17
// link
template <typename TLink>
void link(TLink& lhs, TLink& rhs)
template <typename TLink>
void link(TLink* lhs, TLink* rhs)
template <typename TLink>
void link(TLink& lhs, TLink* rhs)
template <typename TLink>
void link(TLink* lhs, TLink& rhs)
// link_splice
template <typename TLink>
void link_splice(TLink& lhs, TLink& rhs)
template <typename TLink>
void link_splice(TLink* lhs, TLink* rhs)
template <typename TLink>
void link_splice(TLink& lhs, TLink* rhs)
template <typename TLink>
void link_splice(TLink* lhs, TLink& rhs)
template <typename TLink>
void link_splice(TLink& lhs, TLink& first, TLink& last)
template <typename TLink>
void link_splice(TLink* lhs, TLink& first, TLink& last)
// unlink_after
template <typename TLink>
TLink* unlink_after(TLink& node)
template <typename TLink>
TLink* unlink_after(TLink& before, TLink& last)
// is_linked
template <typename TLink>
bool is_linked(TLink& node)
template <typename TLink>
bool is_linked(TLink* node)
// link_clear
template <typename TLink>
void link_clear(TLink& start)
template <typename TLink>
void link_clear(TLink* start)
// link_clear_range
template <typename TLink>
void link_clear_range(TLink& start)
template <typename TLink>
void link_clear_range(TLink* start)
// create_linked_list
template <typename TLink, typename... TLinks>
TLink* create_linked_list(TLink& first, TLinks&... links)
Create a linked list from a number of forward_link nodes.
// detach_linked_list
template <typename TLink>
void detach_linked_list(TLink& first)
template <typename TLink>
void detach_linked_list(TLink* first)
____________________________________________________________________________________________________
Link test
20.37.0
template <typename T>
etl::is_forward_link
Tests if type T is an etl::is_forward_link
template <typename T>
etl::is_forward_link_v
From C++17
____________________________________________________________________________________________________
Bidirectional link
template <const size_t ID_>
struct bidirectional_link
____________________________________________________________________________________________________
Template parameters
const size_t ID_ A unique id for this link level.
____________________________________________________________________________________________________
Public constants
enum ID The unique id for this link level.
____________________________________________________________________________________________________
Public variables
bidirectional_link<ID>* etl_previous A pointer to the previous bidirectional link at this level.
bidirectional_link<ID>* etl_next A pointer to the next bidirectional link at this level.
____________________________________________________________________________________________________
Public functions
clear() Clears the pointers to nullptr.
reverse()Reverses the links.
____________________________________________________________________________________________________
Link functions
void etl::link<type>(lhs, rhs)
Link lhs to rhs.
void etl::link_splice<type>(lhs, rhs)
Link lhs to rhs and rhs to what lhs pointed to. If lhs is not nullptr then it must be initialised.
void etl::link_splice<type>(lhs, first, last)
Link lhs to the range first, last and last to what lhs pointed to. If lhs is not nullptr then it must be initialised.
void etl::unlink(node)
Unlink the specified node. Elements either side are joined.
void etl::unlink(first, last)
Unlinks the range of nodes from first to last inclusive.
The range first/last remain linked to each other.
____________________________________________________________________________________________________
Link test
20.37.0
template <typename T>
etl::is_bidirectional_link
Tests if type T is an etl::is_bidirectional_link
template <typename T>
etl::is_bidirectional_link_v
From C++17
____________________________________________________________________________________________________
Tree link
template <const size_t ID_>
struct tree_link
____________________________________________________________________________________________________
Template parameters
const size_t ID_ A unique id for this link level.
____________________________________________________________________________________________________
Public constants
enum ID The unique id for this link level.
____________________________________________________________________________________________________
Public variables
tree_link<ID>* etl_parent A pointer to the parent tree link at this level.
tree_link<ID>* etl_left A pointer to the left tree link at this level.
tree_link<ID>* etl_right A pointer to the right tree link at this level.
____________________________________________________________________________________________________
Public functions
clear() Clears the pointers to nullptr.
____________________________________________________________________________________________________
Link functions
void etl::link_left<type>(parent, leaf) Links leaf to the left of parent.
void etl::link_right<type>(parent, leaf) Links leaf to the right of parent.
void etl::link_rotate_left<type>(parent, leaf) Rotates the link left making leaf the new parent.
void etl::link_rotate_right<type>(parent, leaf) Rotates the link right making leaf the new parent.
void etl::link_rotate<type>(parent, leaf) Rotates the link left or right making leaf the new parent.
Chooses left or right rotate depending on the leaf connection.
____________________________________________________________________________________________________
Link test
20.37.0
template <typename T>
etl::is_tree_link
Tests if type T is an etl::is_tree_link
template <typename T>
etl::is_tree_link_v
From C++17
____________________________________________________________________________________________________
Example 1
A simple two level intrusive list.
// The link levels
typedef etl::bidirectional_link<0> level0_t;
typedef etl::bidirectional_link<1> level1_t;
constexpr bool is_bdl = etl::is_bidirectional_link_v<level0_t>;
// The item stored in the lists
struct item : public level0_t, public level1_t
{
item(int value)
:: value(value)
{
}
int value;
};
item data0(0);
item data1(1);
item data2(2);
item data3(3);
etl::intrusive_list<item, level0_t> level0_list;
etl::intrusive_list<item, level1_t> level1_list;
// Add items to level0 list
level0_list.push_back(data0);
level0_list.push_back(data1);
level0_list.push_back(data2);
// Add items to level1 list
level1_list.push_back(data3);
level1_list.push_back(data2);
level1_list.push_back(data1);
____________________________________________________________________________________________________
Example 2
Manual list manipulation.
typedef etl::bidirectional_link<0> level0_t;
typedef etl::bidirectional_link<1> level1_t;
// The item stored in the lists
struct item : public level0_t, public level1_t
{
item(int value)
:: value(value)
{
}
int value;
};
item data0(0);
item data1(1);
item data2(2);
item data3(3);
// Set the first and last nodes links to nullptr.
data0.level0_t::clear();
data3.level0_t::clear();
// Make the links.
etl::link<level0_t>(data0, data1);
etl::link<level0_t>(data1, data2);
etl::link<level0_t>(data2, data3); // Level 0 = data0, data1, data2, data3
// Set the first and last nodes links to nullptr.
data2.level1_t::clear();
data1.level1_t::clear();
// Make the links.
etl::link<level1_t>(data2, data3);
etl::link<level1_t>(data3, data0);
etl::link<level1_t>(data0, data1); // Level 1 = data2, data3, data0, data1
// Disconnect a node.
etl::unlink<level1_t>(data3); // Level 1 = data2, data0, data1
TLink*TLink*

View File

@ -1,256 +0,0 @@
flat_map
flat_multimap
A fixed capacity map based on a sorted vector.
The container is an associative lookup table with O(N) insertion and erase, and O(log N) search.
This container is best used for tables that are occasionally updated and spend most of their time being searched.
The interface is most similar to std::map.
Uses std::less as the default key comparison method.
etl::flat_map<typename TKey, typename TMapped, size_t SIZE, TKeyCompare = etl::less>
Inherits from etl::iflat_map<TKey, TMapped, TKeyCompare>
etl::iflat_map may be used as a size independent pointer or reference type for any etl::flat_map instance.
____________________________________________________________________________________________________
Template deduction guides
C++17 and above
template <typename... TPairs>
etl::flat_map(TPairs...)
Example
etl::flat_map data{ etl::pair{0, 1}, etl::pair{2, 3}, etl::pair{4, 5}, etl::pair{6, 7} };
Defines data as an flat_map of int/int pairs, of length 4, containing the supplied data.
____________________________________________________________________________________________________
Make template
C++11 and above
template <typename TKey,
typename TMapped,
typename TKeyCompare = etl::less<TKey>,
typename... TPairs>
constexpr auto make_flat_map(TValues&&... values)
Example
auto data = etl::make_flat_map<int, int>(etl::pair{0, 1}, etl::pair{2, 3},
etl::pair{4, 5}, etl::pair{6, 7});
____________________________________________________________________________________________________
Member types
key_type TKey
mapped_type TMapped
value_type pair<const key_type, mapped_type>
The type is either std::pair (default) or etl::pair (ETL_NO_STL)
size_type std::size_t
difference_type std::ptrdiff_t
reference T&
const_reference const T&
rvalue_reference T&&
pointer T*
const_pointer const T*
iterator Random access iterator
const_iterator Constant random access iterator
reverse_iterator reverse_iterator<iterator>
const_reverse_iterator reverse_iterator<const_iterator>
____________________________________________________________________________________________________
Static Constants
MAX_SIZE The maximum size of the flat map.
____________________________________________________________________________________________________
Constructor
etl::flat_map<Tkey, TMapped, SIZE, TKeyCompare>();
etl::flat_map(const flat_map& other)
etl::flat_map(flat_map&& other)
template <typename TIterator>
etl::flat_map<Tkey, TMapped, SIZE, TKeyCompare>(TIterator begin, TIterator end);
____________________________________________________________________________________________________
Element access
TMapped& at(key_parameter_t key)
const TMapped& at(key_parameter_t key) const
Returns a reference or const reference to the indexed element.
Emits an etl::flat_map_out_of_range if the key is not in the table. If asserts or exceptions are not enabled then undefined behaviour occurs.
____________________________________________________________________________________________________
TMapped& operator[](key_parameter_t key)
const TMapped& operator[](key_parameter_t key) const
Returns a reference or const reference to the indexed element.
If the key is not in the table then a new entry is created.
____________________________________________________________________________________________________
Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
Returns an iterator to the beginning of the map.
____________________________________________________________________________________________________
iterator end()
const_iterator end() const
const_iterator cend() const
Returns an iterator to the end of the map.
____________________________________________________________________________________________________
iterator rbegin()
const_iterator rbegin() const
const_iterator crbegin() const
Returns a reverse iterator to the beginning of the map.
____________________________________________________________________________________________________
iterator rend()
const_iterator rend() const
const_iterator crend() const
Returns a reverse iterator to the end of the map.
____________________________________________________________________________________________________
Capacity
bool empty() const
Returns true if the size of the map is zero, otherwise false.
____________________________________________________________________________________________________
bool full() const
Returns true if the size of the lookup is SIZE, otherwise false.
____________________________________________________________________________________________________
size_t size() const
Returns the size of the lookup.
____________________________________________________________________________________________________
size_t max_size() const
Returns the maximum possible size of the map.
____________________________________________________________________________________________________
size_t available() const
Returns the remaining available capacity in the map.
____________________________________________________________________________________________________
Modifiers
flat_map& operator = (const flat_map& rhs)
flat_map& operator = (flat_map&& rhs)
Copies or moves the data from another flat map.
____________________________________________________________________________________________________
pair<iterator, bool> insert(const value_type& value)
pair<iterator, bool> insert(value_type&& value)
iterator insert(iterator position, const value_type& value)
iterator insert(iterator position, value_type&& value)
template <typename TIterator>
void insert(TIterator first, TIterator last)
Inserts values in to the map.
If the map is full then emits an etl::flat_map_full. If asserts or exceptions are not enabled then undefined behaviour occurs.
The return type is either std::pair (default) or etl::pair (ETL_NO_STL)
____________________________________________________________________________________________________
pair<iterator, bool> emplace((const value_type& value))
pair<iterator, bool> emplace(const key_type& key, const mapped_type& value)
Inserts key/value pairs into the map by constructing directly into storage.
The return type is either std::pair (default) or etl::pair (ETL_NO_STL)
____________________________________________________________________________________________________
Inserts key/value pairs into the map by constructing directly into storage. The value is constructed from the set of 'value' parameters.
C++03
template <typename T1>
pair<iterator, bool> emplace(const key_type& key, const T1& value1)
template <typename T1, typename T2>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2)
template <typename T1, typename T2, typename T3>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3)
template <typename T1, typename T2, typename T3, typename T4>
pair<iterator, bool> emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3, const T4& value4)
The emplace functions differ from that of std::map in that, due to C++03 not supporting 'perfect forwarding', the values for constructing mapped types must be listed as parameters and not nested in a 'mapped' value parameter.
The return type is either std::pair (default) or etl::pair (ETL_NO_STL)
C++11
template <typename ... Args>
pair<iterator, bool> emplace(const key_type& key, Args&& ... args)
____________________________________________________________________________________________________
size_t erase(key_value_parameter_t key)
void erase(iterator i_element)
void erase(iterator first, iterator last)
20.20.0
iterator erase(const_iterator i_element)
iterator erase(const_iteratorfirst, const_iteratorlast)
20.21.0
template <typename K>
size_t erase(K&& key)
Erases values in the map.
Returns an iterator to the next element in the map.
Iterator parameters are not checked for validity.
____________________________________________________________________________________________________
void clear();
Clears the lookup to a size of zero.
____________________________________________________________________________________________________
Search
iterator find(key_value_parameter_t key)
const_iterator find(key_value_parameter_t key) const
iterator lower_bound(key_value_parameter_t key)
const_iterator lower_bound(key_value_parameter_t key) const
iterator upper_bound(key_value_parameter_t key)
const_iterator upper_bound(key_value_parameter_t key) const
pair<iterator, iterator> equal_range(key_value_parameter_t key)
pair<const_iterator, const_iterator> equal_range(key_value_parameter_t key) const
The return type is either std::pair (default) or etl::pair (ETL_NO_STL)
____________________________________________________________________________________________________20.21.0
C++11 or above
For comparators that define is_transparent.
template <typename K>
iterator find(const K& key)
template <typename K>
const_iterator find(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
iterator lower_bound(const K& key)
template <typename K>
const_iterator lower_bound(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
iterator upper_bound(const K& key)
template <typename K>
const_iterator upper_bound(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
pair<iterator, iterator> equal_range(const K& key)
template <typename K>
pair<const_iterator, const_iterator> equal_range(const K& key) const
____________________________________________________________________________________________________
20.21.0
bool contains(key_value_parameter_t key) const
Check if the container contains the key.
20.21.0
C++11 or above
For comparators that define is_transparent.
template <typename K>
bool contains(const K& k) const
Check if the container contains the key.
____________________________________________________________________________________________________
Non-member functions
Lexicographically comparisons
== true if the contents of the maps are equal, otherwise false.
!= true if the contents of the maps are not equal, otherwise false.
___________________________________________________________________________________________________
Technical stuff
Flat maps are usually implemented internally as a sorted vector of key/value pairs. Whilst this makes searching fast, it can have a detrimental effect when items are inserted into a container that stores complex, non-trivial keys or values.
As inserting requires that all of the items above the insert position must be shifted, this can become an expensive operation for larger containers.
To improve insertion performance ETL flat maps are implemented as vectors of pointers to key/value pairs, sorted by key value. An insertion will involve a copy of a range of pointers; an operation that can be made very fast.
The downside is that access to an item via an iterator will involve one indirection and the overhead of the container will be one pointer per item. A normal flat map implementation does not have this overhead.
________________________________________________________________________________________________________________________________________________________________________________________________________

View File

@ -1,234 +0,0 @@
flat_set
flat_multiset
A fixed capacity set based on a sorted vector.
The container is an associative lookup table with O(N) insertion and erase, and O(log N) search.
This container is best used for tables that are occasionally updated and spend most of their time being searched.
The interface is most similar to std::set.
Uses std::less as the default key comparison method.
etl::flat_set<typename T, const size_t SIZE, TCompare = etl::less>
Inherits from etl::iflat_set<T, TCompare>
etl::iflat_set may be used as a size independent pointer or reference type for any etl::flat_set instance..
____________________________________________________________________________________________________
Template deduction guides
C++17 and above
template <typename... T>
etl::flat_set(T...)
Example
etl::flat_set data{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Defines data as an flat_set of int, of length 10, containing the supplied data.
____________________________________________________________________________________________________
Make template
C++11 and above
template <typename TKey,
typename TKeyCompare = etl::less<TKey>,
typename... TPairs>
constexpr auto make_flat_set(TValues&&... values)
Example
auto data = etl::make_flat_set<int>(0, 1, 2, 3, 4, 5, 6, 7, 8, 9 );
____________________________________________________________________________________________________
Member types
key_type T
value_type T
size_type std::size_t
difference_type std::ptrdiff_t
reference T&
const_reference const T&
rvalue_reference T&&
pointer T*
const_pointer const T*
iterator Random access iterator
const_iterator Constant random access iterator
reverse_iterator reverse_iterator<iterator>
const_reverse_iterator reverse_iterator<const_iterator>
____________________________________________________________________________________________________
Static Constants
MAX_SIZE The maximum size of the flat set.
____________________________________________________________________________________________________
Constructor
etl::flat_set<T, SIZE, TCompare>();
etl::flat_set(const flat_set& other)
etl::flat_set(flat_set&&)
template <typename TIterator>
etl::flat_set<T, SIZE, TCompare>(TIterator begin, TIterator end);
____________________________________________________________________________________________________
Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
Returns an iterator to the beginning of the set.
____________________________________________________________________________________________________
iterator end()
const_iterator end() const
const_iterator cend() const
Returns an iterator to the end of the set.
____________________________________________________________________________________________________
iterator rbegin()
const_iterator rbegin() const
const_iterator crbegin() const
Returns a reverse iterator to the beginning of the set.
____________________________________________________________________________________________________
iterator rend()
const_iterator rend() const
const_iterator crend() const
Returns a reverse iterator to the end of the set.
____________________________________________________________________________________________________
Capacity
bool empty() const
Returns true if the size of the set is zero, otherwise false.
____________________________________________________________________________________________________
bool full() const
Returns true if the size of the lookup is SIZE, otherwise false.
____________________________________________________________________________________________________
size_t size() const
Returns the size of the lookup.
____________________________________________________________________________________________________
size_t max_size() const
Returns the maximum possible size of the set.
____________________________________________________________________________________________________
size_t available() const
Returns the remaining available capacity in the set.
____________________________________________________________________________________________________
Modifiers
flat_set& operator = (const flat_set& rhs)
flat_set& operator = (flat_set&& rhs)
Copies or moves the data from another flat set.
____________________________________________________________________________________________________
pair<iterator, bool> insert(const_reference value)
iterator insert(iterator position, const_reference value)
pair<iterator, bool> insert(rvalue_reference value)
iterator insert(iterator position, rvalue_reference value)
template <typename TIterator>
void insert(TIterator first, TIterator last)
Inserts values in to the set.
If the set is full then emits an etl::flat_set_full. If asserts or exceptions are not enabled then undefined behaviour occurs.
____________________________________________________________________________________________________
pair<iterator, bool> emplace(parameter_t value)
Inserts a value into the map by constructing directly into storage.
____________________________________________________________________________________________________
C++03
template <typename T1>
pair<iterator, bool> emplace(const T1& value1)
template <typename T1, typename T2>
pair<iterator, bool> emplace(const T1& value1, const T2& value2)
template <typename T1, typename T2, typename T3>
pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3)
template <typename T1, typename T2, typename T3, typename T4>
pair<iterator, bool> emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4)
Inserts values into the map by constructing directly into storage. The value is constructed from the set of 'value' parameters.
C++11
template <typename ... Args>
pair<iterator, bool> emplace(Args && ... args)
____________________________________________________________________________________________________
size_t erase(parameter_t key)
void erase(iterator i_element)
void erase(iterator first, iterator last)
>=20.20.0
iterator erase(iterator i_element)
iterator erase(const_iterator i_element)
iterator erase(const_iterator first, const_iterator last)
20.21.0
template <typename K>
size_t erase(K&& key)
Erases values in the set.
Iterator parameters are not checked for validity.
____________________________________________________________________________________________________
void clear();
Clears the lookup to a size of zero.
____________________________________________________________________________________________________
Search
iterator find(parameter_t key)
const_iterator find(parameter_t key) const
iterator lower_bound(parameter_t key)
const_iterator lower_bound(parameter_t key) const
iterator upper_bound(parameter_t key)
const_iterator upper_bound(parameter_t key) const
pair<iterator, iterator> equal_range(parameter_t key)
pair<const_iterator, const_iterator> equal_range(parameter_t key) const
____________________________________________________________________________________________________20.21.0
C++11 or above
For comparators that define is_transparent.
template <typename K>
iterator find(const K& key)
template <typename K>
const_iterator find(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
iterator lower_bound(const K& key)
template <typename K>
const_iterator lower_bound(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
iterator upper_bound(const K& key)
template <typename K>
const_iterator upper_bound(const K& key) const
____________________________________________________________________________________________________
20.21.0
C++11 or above
template <typename K>
pair<iterator, iterator> equal_range(const K& key)
template <typename K>
pair<const_iterator, const_iterator> equal_range(const K& key) const
____________________________________________________________________________________________________
20.21.0
bool contains(key_value_parameter_t key) const
Check if the container contains the key.
20.21.0
C++11 or above
For comparators that define is_transparent.
template <typename K>
bool contains(const K& k) const
Check if the container contains the key.
____________________________________________________________________________________________________
Non-member functions
Lexicographically comparisons
== true if the contents of the sets are equal, otherwise false.
!= true if the contents of the sets are not equal, otherwise false.
____________________________________________________________________________________________________
How it works
Flat sets are usually implemented internally as a sorted vector of values. Whilst this makes searching fast, it can have a detrimental effect when items are inserted into a container that stores complex, non-trivial values.
As Inserting requires that all of the items above the insert position must be shifted, this can become an expensive operation for larger containers.
To improve insertion performance ETL flat sets are implemented as vectors of pointers to values, sorted by value. An insertion will involve a copy of a range of pointers; an operation that can be made very fast.
The downside is that access to an item via an iterator will involve one indirection and the overhead of the container will be one pointer per item. A normal flat set implementation does not have this overhead.
static

View File

@ -1,42 +0,0 @@
imemory_block_allocator
The base of all memory block allocators. Inherits from traits class etl::successor<imemory_block_allocator>.
Defines the functionality and interface for derived memory block allocators.
The class defines a public non-virtual interface and protected virtual overrides.
A derived class must define these overrides.
____________________________________________________________________________________________________
Non-virtual public interface
void* allocate(size_t required_size, size_t required_alignment)
Attempts to allocate a memory block of the required size (in char) and alignment and return a pointer to it.
If the allocator is unable to do this and it has a successor, then the request will be passed on to it, otherwise ETL_NULLPTR will be returned.
____________________________________________________________________________________________________
bool release(const void* const p)
Attempts to release a memory block and returns true if successful.
If the allocator is unable to do this and it has a successor, then the request will be passed on to it, otherwise false will be returned.
____________________________________________________________________________________________________
Virtual protected interface
virtual void* allocate_block(size_t required_size, size_t required_alignment) = 0;
The derived class must implement this function.
It will attempt to allocate a block of the required size. If it is unable to, it must return ETL_NULLPTR.
____________________________________________________________________________________________________
virtual bool release_block(const void* const) = 0;
The derived class must implement this function.
It will attempt to release a block. If it is unable to, it must return false.
____________________________________________________________________________________________________
Inherited from successor<imemory_block_allocator>
typedef T successor_type;
void set_successor(successor_type& s)
Set the successor.
____________________________________________________________________________________________________
successor_type& get_successor() const
Get the successor.
____________________________________________________________________________________________________
bool has_successor() const
Do we have a successor?

View File

@ -1,314 +0,0 @@
indirect_vector
A fixed capacity vector that uses indirection to access the elements.
Can be more efficient for vectors of large objects, especially when inserting, erasing or sorting.
Supplies function adaptors to allow efficient application of external algorithms.
STL equivalent: None
etl::indirect_vector<typename T, size_t SIZE>
etl::indirect_vector_ext<typename T>
Inherits from etl::iindirect_vector<T>
etl::iindirect_vector may be used as a size independent pointer or reference type for any etl::indirect_vector instance.
____________________________________________________________________________________________________
External buffer
etl::indirect_vector_ext<typename T>
With this template, the constructor expects pointer and size parameters to the externally provided indirection lookup vector and pool.
____________________________________________________________________________________________________
Template deduction guides
C++17 and above
template <typename... T>
etl::indirect_vector(T...)
Example
etl::indirect_vector data{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
Defines data as an indirect_vector of int, of length 10, containing the supplied data.
____________________________________________________________________________________________________
Member types
value_type T
size_type std::size_t
difference_type std::ptrdiff_t
reference value_type&
const_reference const value_type&
pointer value_type*
const_pointer const value_type*
indirect_iterator Iterator to the internal lookup vector
indirect_const_iterator Constant iterator to the internal lookup vector
const_pointer const value_type*
iterator Random access iterator
const_iterator Constant random access iterator
reverse_iterator std::reverse_iterator<iterator>
const_reverse_iterator std::reverse_iterator<const_iterator>
____________________________________________________________________________________________________
Iterators
Both iterator and const_iterator define indirection() member functions that return an indirect_iterator or indirect_const_iterator to the internal lookup vector.
Access to these iterators allows an external algorithm to manipulate the indirect_vector without moving the objects themselves, thereby vastly increasing the efficiency for vectors of large objects.
____________________________________________________________________________________________________
Function Object Adaptors
Unary and binary function object wrappers are defined to allow algorithms to manipulate the contents
of an indirect_vector using a standard function object with indirect iterators.
template <typename TUnaryFunction, typename TReturnType = void>
class unary_function_adaptor
template <typename TBinaryFunction, typename TReturnType = void>
class binary_function_adaptor
Example
Sorting without moving or copying large objects.
// The large data that we are storing in the vector.
struct Data
{
std::array<int, 1000> values;
};
// How to compare Data objects.
bool operator <(const Data& lhs, const Data& rhs)
{
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
// The vector of data.
using Vector = etl::indirect_vector<Data, 10>;
Vector v;
// std::less wrapped in a binary_function_adaptor.
using LessThan = typename Vector::binary_function_adaptor<std::less<Data>, bool>;
// Sort the vector without moving or copying actual Data objects.
std::sort(v.begin().indirection(),
v.end().indirection(),
LessThan());
Warning: This technique is not suitable for algorithms that may leave the container with multiple copies of an object, such as std::remove_if. This is because the algorithm may create multiple copies of the indirection iterator, but only one copy of the object that they point to.
____________________________________________________________________________________________________
Constructor
Internal buffer
etl::indirect_vector<typename T, const size_t SIZE>();
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize);
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, const T& value);
template <typename TIterator>
etl::indirect_vector<typename T, const size_t SIZE>(TIterator begin, TIterator end);
etl::indirect_vector<typename T, const size_t SIZE>(const etl::indirect_vector<typename T, const size_t SIZE>&);
etl::indirect_vector<typename T, const size_t SIZE>(etl::indirect_vector<typename T, const size_t SIZE>&&);
____________________________________________________________________________________________________
External buffer
etl::indirect_vector<typename T, const size_t SIZE>(etl::ivector<T*>& lookup, etl::ipool& storage);
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, etl::ivector<T*>& lookup, etl::ipool& storage);
etl::indirect_vector<typename T, const size_t SIZE>(size_t initialSize, const T& value, etl::ivector<T*>& lookup, etl::ipool& storage);
template <typename TIterator>
etl::indirect_vector<typename T, const size_t SIZE>(TIterator begin, TIterator end, etl::ivector<T*>& lookup, etl::ipool& storage);
etl::indirect_vector<typename T, const size_t SIZE>(const etl::indirect_vector<typename T, const size_t SIZE>&, etl::ivector<T*>& lookup, etl::ipool& storage);
etl::indirect_vector<typename T, const size_t SIZE>(etl::indirect_vector<typename T, const size_t SIZE>&&, etl::ivector<T*>& lookup, etl::ipool& storage);
If the vector is full then emits an etl::vector_full. If asserts or exceptions are not enabled then undefined behaviour occurs.
____________________________________________________________________________________________________
Element access
reference at(size_t i)
const_reference at(size_t i) const
Returns a reference or const reference to the indexed element. Emits an etl::vector_out_of_range if the index is out of range of the array. If asserts or exceptions are not enabled then undefined behaviour occurs.
____________________________________________________________________________________________________
reference operator[](size_t i)
const_reference operator[](size_t i) const
Returns a reference or const reference to the indexed element.
if the index is out of range of the array then undefined behaviour occurs.
____________________________________________________________________________________________________
reference front()
const_reference front() const
Returns a reference or const reference to the first element.
Undefined behaviour if the vector is empty.
____________________________________________________________________________________________________
reference back()
const_reference back() const
Returns a reference or const reference to the last element.
Undefined behaviour if the vector is empty.
____________________________________________________________________________________________________
Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
Returns an iterator to the beginning of the vector.
____________________________________________________________________________________________________
iterator end()
const_iterator end() const
const_iterator cend() const
Returns an iterator to the end of the vector.
____________________________________________________________________________________________________
iterator rbegin()
const_reverse_iterator rbegin() const
const_reverse_iterator crbegin() const
Returns a reverse iterator to the beginning of the vector.
____________________________________________________________________________________________________
iterator rend()
const_reverse_iterator rend() const
const_reverse_iterator crend() const
Returns a reverse iterator to the end of the vector.
____________________________________________________________________________________________________
Capacity
bool empty() const
Returns true if the size of the vector is zero, otherwise false.
____________________________________________________________________________________________________
bool full() const
Returns true if the size of the vector is SIZE, otherwise false.
____________________________________________________________________________________________________
size_t size() const
Returns the size of the vector.
____________________________________________________________________________________________________
void resize(size_t new_size, T value = T())
Resizes the vector, up to the maximum capacity. Emits an etl::vector_full if the vector does not have the capacity.
____________________________________________________________________________________________________
size_t max_size() const
Returns the maximum possible size of the vector.
____________________________________________________________________________________________________
size_t capacity() const
Returns the maximum possible size of the vector.
____________________________________________________________________________________________________
size_t available() const
Returns the remaining available capacity in the vector.
____________________________________________________________________________________________________
Modifiers
template <typename TIterator>
void assign(TIterator begin, TIterator end);
void assign(size_t n, const T& value);
Fills the vector with the values. Emits etl::vector_iterator if the distance between begin and end is illegal.
(debug mode only). If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
void push_back(const T& value);
void push_back(T&& value);
Pushes a value to the back of the vector.
If the vector is full then emits an etl::vector_full. If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
C++03
void emplace(); 20.38.0
void emplace(const T1& value1);
void emplace(const T1& value1, const T2& value2);
void emplace(const T1& value1, const T2& value2, const T3& value3);
void emplace(const T1& value1, const T2& value2, const T3& value3, const T4& value4);
C++11
template <typename… Args>
void emplace(Args&&… args);
Constructs an item at the back of the the vector 'in place'.
Supports up to four constructor parameters.
Pushes a value to the back of the vector. The first pushes a value, the second allocates the new element but does not initialise it.
If the vector is full then emits an etl::vector_full. If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
<=20.35.9
void emplace_back(const T1& value1);
void emplace_back(const T1& value1, const T2& value2);
void emplace_back(const T1& value1, const T2& value2, const T3& value3);
void emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4);
>=20.35.10
reference emplace_back(); 20.38.0
reference emplace_back(const T1& value1);
reference emplace_back(const T1& value1, const T2& value2);
reference emplace_back(const T1& value1, const T2& value2, const T3& value3);
reference emplace_back(const T1& value1, const T2& value2, const T3& value3, const T4& value4);
C++11
<=20.35.9
template <typename Args...>
void emplace_back(Args&&... args);
>=20.35.10
template <typename Args...>
reference emplace_back(Args&&... args);
Constructs an item at the back of the the vector 'in place'.
Supports up to four constructor parameters.
If the vector is full then emits an etl::vector_full. If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
void pop_back();
Pop a value from the back of the vector.
If the vector is empty and ETL_CHECK_PUSH_POP is defined then emits an etl::vector_empty. If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
<=20.19.0
template <typename TIterator>
void insert(iterator position, TIterator begin, TIterator end);
iterator insert(iterator position, const T& value);
iterator insert(iterator position, T&& value);
void insert(iterator position, size_t n, const T& value);
>=20.20.0
template <typename TIterator>
void insert(const_iterator position, TIterator begin, TIterator end);
iterator insert(const_iterator position, const T& value);
iterator insert(const_iterator position, T&& value);
iterator insert(const_iterator position, size_t n, const T& value);
Inserts values in to the vector.
If the vector is full then emits an etl::vector_full exception. If asserts or exceptions are not enabled undefined behaviour occurs.
____________________________________________________________________________________________________
template <typename TIterator>
iterator erase(TIterator begin, TIterator end);
<=20.19.0
iterator erase(iterator position);
>=20.20.0
iterator erase(iterator position);
iterator erase(const_iterator position);
Erases values in the vector.
Iterators are not checked.
____________________________________________________________________________________________________
void clear()
Clears the vector to a size of zero.
____________________________________________________________________________________________________
void sort()
Sorts the elements using the 'less than' operator.
template <typename TCompare>
void sort(TCompare compare)
Sorts the elements using the supplied compare.
void sort(iterator first, iterator last)
Sorts a range of elements using the supplied 'less than' operator.
template <typename TCompare>
void sort(iterator first, iterator last, TCompare compare)
Sorts a range of elements using the supplied compare.
____________________________________________________________________________________________________
void stable_sort()
Stable sorts the elements using the 'less than' operator.
template <typename TCompare>
void stable_sort(TCompare compare)
Stable sorts the elements using the supplied compare.
void stable_sort(iterator first, iterator last)
Stable sorts a range of elements using the supplied 'less than' operator.
template <typename TCompare>
void stable_sort(iterator first, iterator last, TCompare compare)
Stable sorts a range of elements using the supplied compare.
____________________________________________________________________________________________________
Non-member functions
== true if the contents of the vectors are equal, otherwise false.
!= true if the contents of the vectors are not equal, otherwise false.
< true if the contents of the lhs are lexicographically less than the contents of the rhs, otherwise false.
<= true if the contents of the lhs are lexicographically less than or equal to the contents of the rhs, otherwise false.
> true if the contents of the lhs are lexicographically greater than the contents of the rhs, otherwise false.
>= true if the contents of the lhs are lexicographically greater than or equal to the contents of the rhs, otherwise false.

View File

@ -1,159 +0,0 @@
intrusive_list
An intrusive list.
No STL equivalent.
etl::intrusive_list<typename TValue, typename TLink>
TValue is the type that contains the actual values. It is derived from Tlink. Tlink is the link type for this list.
See Intrusive links.
Before 20.37.0 the default link type was etl::bidirectional_link<0>
____________________________________________________________________________________________________
Member types
typedef TLink link_type;
typedef TValue value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef size_t size_type;
____________________________________________________________________________________________________
Constructors
etl::intrusive_list<typename TValue, typename TLink>();
____________________________________________________________________________________________________
template <typename TIterator>
etl::intrusive_list<typename TValue, typename TLink>(TIterator begin, TIterator end);
____________________________________________________________________________________________________
template <typename... TLinks>
intrusive_list(TLink& first, TLinks&... links);
____________________________________________________________________________________________________
Element access
TValue& front()
const T& front() const
Returns a reference or const reference to the first element.
____________________________________________________________________________________________________
TValue& back()
const T& back() const
Returns a reference or const reference to the last element.
____________________________________________________________________________________________________
Iterators
iterator begin()
const_iterator begin() const
const_iterator cbegin() const
Returns an iterator to the beginning of the list.
____________________________________________________________________________________________________
iterator end()
const_iterator end() const
const_iterator cend() const
Returns an iterator to the end of the list.
____________________________________________________________________________________________________
iterator rbegin()
const_iterator rbegin() const
const_iterator crbegin() const
Returns a reverse iterator to the beginning of the list.
____________________________________________________________________________________________________
iterator rend()
const_iterator rend() const
const_iterator crend() const
Returns a reverse iterator to the end of the list.
____________________________________________________________________________________________________
Capacity
bool empty() const
Returns true if the size of the list is zero, otherwise false.
____________________________________________________________________________________________________
size_t size() const
Returns the size of the list.
____________________________________________________________________________________________________
Modifiers
template <typename TIterator>
void assign(TIterator begin, TIterator end);
Fills the list with the values.
____________________________________________________________________________________________________
void push_front(value_type& value);
Pushes a value to the front of the list.
____________________________________________________________________________________________________
void push_back(value_type& value);
Pushes a value to the back of the list.
____________________________________________________________________________________________________
void pop_front();
Pop a value from the front of the list.
Emits an etl::intrusive_list_empty if the list is empty. If asserts or exceptions are disabled then undefined behaviour occurs.
____________________________________________________________________________________________________
void pop_back();
Pop a value from the back of the list.
Emits an etl::intrusive_list_empty if the list is empty. If asserts or exceptions are disabled then undefined behaviour occurs.
____________________________________________________________________________________________________
template <typename TIterator>
void insert(iterator position, TIterator begin, TIterator end);
iterator insert(iterator position, value_type& value);
Inserts values in to the list.
position is not checked for validity.
____________________________________________________________________________________________________
template <typename TIterator>
iterator erase(TIterator begin, TIterator end);
iterator erase(iterator position);
Erases values in the list.
Iterators are not checked for validity.
____________________________________________________________________________________________________
void clear();
Clears the list to a size of zero. No elements are destructed.
____________________________________________________________________________________________________
void splice(iterator position, list_type& list);
void splice(iterator position, list_type& list, iterator isource);
void splice(iterator position, list_type& list, iterator begin_, iterator end_);
Splices elements from a list into this list.
Iterators are not checked for validity.
____________________________________________________________________________________________________
void merge(list_type& list);
Merges the sorted elements of 'list' into this list. Merges are stable.
If a debug compile and asserts or exceptions are enabled than an etl::intrusive_list_unsorted is emitted if either list is unsorted, otherwise undefined behaviour occurs.
____________________________________________________________________________________________________
template <typename TCompare>
void merge(list_type& list, Tcompare compare);
Merges the sorted elements of list into this list. Comparison functor is supplied in compare. Merges are stable.
If a debug compile and asserts or exceptions are enabled than an etl::intrusive_list_unsorted is emitted if either list is unsorted, otherwise undefined behaviour occurs.
____________________________________________________________________________________________________
Operations
void remove(const T& value);
Removes from the container all the elements that compare equal to value.
____________________________________________________________________________________________________
template <typename TPredicate>
void remove_if(TPredicate predicate);
Removes from the container all the elements that satisfy predicate.
____________________________________________________________________________________________________
void unique();
template <typename TPredicate>
void unique(TPredicate predicate);
The first version removes all but the first element from every group of consecutive elements.
The second removes all but the first element from every group of consecutive elements that satisfy the binary predicate.
____________________________________________________________________________________________________
void sort();
template <typename TCompare>
void sort(TCompare compare);
The first version sorts using the < operator.
The second uses the supplied compare function.
____________________________________________________________________________________________________
void reverse();
Reverses the order of the list.
____________________________________________________________________________________________________
Non-member functions
== true if the contents of the lists are equal, otherwise false.
!= true if the contents of the lists are not equal, otherwise false.
< true if the contents of the lhs are lexicographically less than the contents of the rhs, otherwise false.
<= true if the contents of the lhs are lexicographically less than or equal to the contents of the rhs, otherwise false.
> true if the contents of the lhs are lexicographically greater than the contents of the rhs, otherwise false.
>= true if the contents of the lhs are lexicographically greater than or equal to the contents of the rhs, otherwise false.

View File

@ -1,99 +0,0 @@
multi_span
This class implements a span of a range of spans.
Allows implementation of Scatter/Gather to multiple buffers or ports.
Iterating through the multi_span will iterate through the collection of spans consecutively.
The list of spans must be in a contiguous list, such as an array or vector.
etl::multi_span<typename T>
Where T is the element type of the spans.
____________________________________________________________________________________________________
Member types
element_type T
value_type remove_cv<T>::type
size_type size_t
difference_type ptrdiff_t
reference value_type&
const_reference const value_type&
pointer value_type*
const_pointer const value_type*
iterator Forward iterator <20.39.5
Bidirectional iterator >=20.39.5
const_iterator Constant Forward iterator <20.39.5
Constant bidirectional iterator >=20.39.5
reverse_iterator ETL_OR_STD::reverse_iterator<iterator>
const_reverse_iterator ETL_OR_STD::reverse_iterator<const_iterator>
span_type etl::span<T>
span_list_type etl::span<const span_type>
____________________________________________________________________________________________________
Constructors
ETL_CONSTEXPR multi_span(span_list_type span_list)
____________________________________________________________________________________________________
template <typename TContainer>
ETL_CONSTEXPR multi_span(TContainer& a) ETL_NOEXCEPT
____________________________________________________________________________________________________
template <typename TContainer>
ETL_CONSTEXPR multi_span(const TContainer& a) ETL_NOEXCEPT
____________________________________________________________________________________________________
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin, TIterator end)
____________________________________________________________________________________________________
template <typename TIterator>
ETL_CONSTEXPR multi_span(TIterator begin, size_t length)
____________________________________________________________________________________________________
ETL_CONSTEXPR multi_span(const multi_span& other)
____________________________________________________________________________________________________
Access
ETL_CONSTEXPR14 multi_span& operator =(const multi_span& other) ETL_NOEXCEPT
Assign from a other multi_span
____________________________________________________________________________________________________
Iterators
ETL_CONSTEXPR iterator begin() const ETL_NOEXCEPT
Returns an iterator to the beginning of the span.
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator end() const ETL_NOEXCEPT
Returns an iterator to the end of the span.
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator cbegin() const ETL_NOEXCEPT
Returns a const iterator to the beginning of the span.
20.39.5
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator cend() const ETL_NOEXCEPT
Returns a const iterator to the end of the span.
20.39.5
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator rbegin() const ETL_NOEXCEPT
Returns a reverse iterator to the beginning of the span.
20.39.5
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator rend() const ETL_NOEXCEPT
Returns a reverse iterator to the end of the span.
20.39.5
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator crbegin() const ETL_NOEXCEPT
Returns a const reverse iterator to the beginning of the span.
20.39.5
____________________________________________________________________________________________________
ETL_CONSTEXPR iterator crend() const ETL_NOEXCEPT
Returns a const reverse iterator to the end of the span.
20.39.5
____________________________________________________________________________________________________
Capacity
ETL_CONSTEXPR bool empty() const ETL_NOEXCEPT
Returns true if the size of the multi_span is zero, otherwise false.
____________________________________________________________________________________________________
ETL_CONSTEXPR size_t size() const ETL_NOEXCEPT
Returns the size of the multi_span.
____________________________________________________________________________________________________
ETL_CONSTEXPR size_t size_bytes() const ETL_NOEXCEPT
Returns the size of the multi_span in bytes.
____________________________________________________________________________________________________
ETL_CONSTEXPR size_t size_spans() const ETL_NOEXCEPT
Returns the number of the spans.

View File

@ -1,27 +0,0 @@
multi_vector
A fixed capacity multi-dimensional vector.
STL equivalent: None
For C++11 or greater only.
etl::multi_vector<typename T, const size_t Dx...>
See also
vector
____________________________________________________________________________________________________
Description
The etl::multi_vector class is defined as a recursive variadic template.
It defines a multi-dimensional array class based on nested etl::vector definitions.
Example
etl::multi_vector<int, 2, 3, 4>
is equivalent to
etl::vector<etl::vector<etl::vector<int, 4>, 3>, 2>
Each dimension of an etl::multi_vector supports all of the members of an etl::vector.

View File

@ -35,7 +35,7 @@ A class to store FSM states.
Static asserts if state IDs are not 0..N-1 and in order.
Static asserts if there are no states.
Static asserts if any state IDs are greater or equal to `etl::No_State_Change`.
Since: `20.43.0`
From: `20.43.0`
Note: This header is a generated from `fsm_generator.h`. For C++03, to handle more than the standard 16 message types then a new one must be generated.

View File

@ -4,7 +4,7 @@ title: "Hierarchical Finite State Machine"
{{< callout type="info">}}
Header: `hfsm.h`
Since: `20.10.0`
From: `20.10.0`
{{< /callout >}}
Hierarchical Finite State Machine

View File

@ -29,7 +29,7 @@ For C++11 or above, you may pass an rvalue reference.
istate_chart<TParameter>
```
The base for all state charts.
Since: `20.23.0`
From: `20.23.0`
## Types
```cpp
@ -73,7 +73,7 @@ Starts the state chart.
istate_chart<void>
```
The base for all state charts.
Since: `20.23.0`
From: `20.23.0`
## Types
```cpp

View File

@ -152,7 +152,7 @@ initialize_free_space()
```
**Description**
Initializes the free space in the string to null terminators.
Since: `20.3.0`
From: `20.3.0`
---
@ -161,7 +161,7 @@ trim_to_terminator()
```
**Description**
Sets the string length to the first terminating null or the max size if the string.
Since: `20.3.0`
From: `20.3.0`
---
@ -170,7 +170,7 @@ data_end()
```
**Description**
Returns a pointer to the current terminating null.
Since: `20.3.0`
From: `20.3.0`
**Example**
```cpp
@ -358,7 +358,7 @@ template <typename TOperation>
void resize_and_overwrite(size_type new_size, TOperation operation)
```
Resizes the string and overwrites to data using the operation.
Since: `20.39.5`
From: `20.39.5`
---
@ -366,7 +366,7 @@ Since: `20.39.5`
void uninitialized_resize(size_t new_size)
```
Resizes the string, up to the maximum capacity, without initialising the new elements.
Since: `20.4.0`
From: `20.4.0`
---
@ -431,7 +431,7 @@ iterator insert(iterator position, TIterator first, TIterator last)
```cpp
iterator insert(const_iterator position, T value)
```
Since: `20.20.0`
From: `20.20.0`
---
@ -456,7 +456,7 @@ etl::istring& insert(size_type position, const etl::istring& str)
```cpp
etl::istring& insert(size_type position, const etl::string_view& view)
Since: `20.39.5`
From: `20.39.5`
---
@ -475,7 +475,7 @@ etl::istring& insert(size_type position,
size_type subposition,
size_type sublength)
```
Since: `20.39.5`
From: `20.39.5`
---
@ -521,7 +521,7 @@ iterator erase(const_iterator first, const_iterator last)
```
Erases values in the string.
Iterators are not checked.
Since: `20.20.0`
From: `20.20.0`
## Assign
```cpp
@ -899,7 +899,7 @@ etl::wstring<Max_Size> make_string_with_capacity(const wchar(&text) [Size])
---
`char8_t`
Since: `20.38.7`
From: `20.38.7`
```cpp
template <const size_t Max_Size>
etl::u8string<Max_Size> make_string(const char8_t (&text) [Max_Size])

View File

@ -34,7 +34,7 @@ const StringType& to_string(const T value,
`value` The value to convert to a string.
`str` The string in with to place the rendered text.
`append` If true then appends the text to the current string's content. Default `false`.
Since: `20.17.0`
From: `20.17.0`
## Supplied format specification
Where `StringType` is `etl::istring`, `etl::iwstring`, `etl::iu8string`, `etl::iu16string` or `etl::iu32string`.
@ -64,7 +64,7 @@ const StringType& to_string(const T value,
`str` The string in with to place the rendered text.
`format` The format specification.
`append` If `true` then appends the text to the current string's content. Default `false`.
Since: `20.17.0`
From: `20.17.0`
---

View File

@ -4,7 +4,7 @@ title: "callback_timer_atomic"
{{< callout type="info">}}
Header: `callback_timer_atomic.h`
Since: `20.22.0`
From: `20.22.0`
{{< /callout >}}
A software timer class that can manage up to 254 timers. Each one may be repeating or single shot.
@ -23,7 +23,7 @@ etl::icallback_timer_atomic<uint_least8_t MAX_TIMERS, typename TSemaphore>
etl::callback_timer_atomic<typename TSemaphore>
```
Since: `20.25.0`
From: `20.25.0`
From this version, an atomic 'semaphore' counter type must be supplied.
Uses definitions from `timer.h`.
@ -148,7 +148,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`MAX_TIMERS`

View File

@ -4,7 +4,7 @@ title: "callback_timer_deferred_locked"
{{< callout type="info">}}
Header: `callback_timer_deferred_locked.h`
Since: `20.43.0`
From: `20.43.0`
{{< /callout >}}
A software timer class that can manage up to 254 timers. Each one may be repeating or single shot.
@ -189,7 +189,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`Max_Timers`

View File

@ -4,7 +4,7 @@ title: "callback_timer_interrupt"
{{< callout type="info">}}
Header: `callback_timer_interrupt.h`
Since: `20.25.0`
From: `20.25.0`
{{< /callout >}}
A software timer class that can manage up to 254 timers. Each one may be repeating or single shot.
@ -151,7 +151,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`MAX_TIMERS`

View File

@ -175,7 +175,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
---

View File

@ -203,7 +203,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`MAX_TIMERS`

View File

@ -22,7 +22,7 @@ etl::imessage_timer_atomic<uint_least8_t MAX_TIMERS, typename TSemaphore>
etl::message_timer_atomic<typename TSemaphore>
```
Since: `20.25.0`
From: `20.25.0`
From this version, an atomic 'semaphore' counter type must be supplied.
Uses definitions from `timer.h`.
@ -130,7 +130,7 @@ Returns `true` if successful.
etl::timer::id::type time_to_next()
```
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`MAX_TIMERS`

View File

@ -4,7 +4,7 @@ title: "message_timer_interrupt"
{{< callout type="info">}}
Header: `message_timer_interrupt.h`
Since: `20.25.0`
From: `20.25.0`
{{< /callout >}}
A software timer class that can manage up to 254 timers. Each one may be repeating or single shot.
@ -145,7 +145,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
`MAX_TIMERS`

View File

@ -154,7 +154,7 @@ etl::timer::id::type time_to_next()
```
**Description**
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
---

View File

@ -152,7 +152,7 @@ Returns `true` if successful.
etl::timer::id::type time_to_next()
```
Returns the time to the next timeout.
Since: `20.38.0`
From: `20.38.0`
### Constants
```cpp

View File

@ -4,7 +4,7 @@ title: "tuple"
{{< callout type="info">}}
Header: `tuple.h`
Since: `20.41.0`
From: `20.41.0`
Similar to: `std::tuple`
{{< /callout >}}

View File

@ -4,7 +4,7 @@ title: "type_list"
{{< callout type="info">}}
Header: `type_list.h`
Since: `20.39.5`
From: `20.39.5`
{{< /callout >}}
Defines a tuple of types, but unlike a tuple, does not contain any values.
@ -79,7 +79,7 @@ type_lists_are_convertible
```
Checks that types in a type_list are convertible to the type in another.
Defines value as `true` or `false`.
Since: `20.43.0`
From: `20.43.0`
---
@ -88,7 +88,7 @@ template <typename TFromList, typename TToList>
type_lists_are_convertible_v
```
C++17 and above.
Since: `20.43.0`
From: `20.43.0`
## Examples

View File

@ -259,7 +259,7 @@ etl::types<MyType>::const_pointer_const const int* const
## unsigned_type
**ETL extension**
Since: `20.29.0`
From: `20.29.0`
```cpp
template <typename T>
@ -278,7 +278,7 @@ C++11
## signed_type
**ETL extension**
Since: `20.29.0`
From: `20.29.0`
```cpp
template <typename T>
@ -303,7 +303,7 @@ C++11
template <typename... TTypes>
struct has_duplicates
```
Since: `20.39.1`
From: `20.39.1`
C++11 or above
### Members
@ -325,7 +325,7 @@ constexpr bool has_duplicates_v = etl::has_duplicates<TTypes...>::value;
template <typename T, typename... TTypes>
struct has_duplicates_of
```
Since: `20.39.1`
From: `20.39.1`
C++11 or above
### Members
@ -346,7 +346,7 @@ constexpr bool has_duplicates_of_v = etl::has_duplicates_of<T, TTypes...>::value
template <typename T, typename... TTypes>
struct count_of
```
Since: `20.39.1`
From: `20.39.1`
C++11 or above
### Members
@ -362,7 +362,7 @@ constexpr bool count_of_v = etl::count_of<T, TTypes...>::value;
```
## conjunction
Since: `20.40.1`
From: `20.40.1`
```cpp
template <typename... Types>
@ -379,7 +379,7 @@ Forms the logical conjunction (AND) of `Types...`
C++17
## disjunction
Since: `20.40.1`
From: `20.40.1`
```cpp
template <typename... Types>
@ -396,7 +396,7 @@ Forms the logical disjunction (OR) of `Types...`
C++17
## exclusive_disjunction
Since: `20.40.1`
From: `20.40.1`
```cpp
template <typename... Types>
@ -413,7 +413,7 @@ Forms the logical exclusive disjunction (XOR) of `Types...`
C++17
## unwrap_reference, unwrap_ref_decay
Since: `20.40.1`
From: `20.40.1`
```cpp
template <class T>
@ -444,7 +444,7 @@ using unwrap_ref_decay_t;
C++11
## is_specialization
Since: `20.41.0`
From: `20.41.0`
```cpp
template <typename T, template <typename...> class Template>

View File

@ -4,7 +4,7 @@ title: "unaligned_type"
{{< callout type="info">}}
Header: `unaligned_type.h`
Since: `20.23.0`
From: `20.23.0`
{{< /callout >}}
A wrapper for fundamental types around unaligned internal storage.

View File

@ -1246,7 +1246,7 @@ void selection_sort(TIterator first, TIterator last)
```
**Description**
Sorts a range using the selection sort algorithm.
Since: `20.7.0`
From: `20.7.0`
---
@ -1256,7 +1256,7 @@ void selection_sort(TIterator first, TIterator last, TCompare compare)
```
**Description**
Sorts a range using the selection sort algorithm.
Since: `20.7.0`
From: `20.7.0`
## sort

View File

@ -56,7 +56,7 @@ etl::aligned_storage_as<100, double>::type storage;
```
## typed_storage
Since: `20.40.1`
From: `20.40.1`
```cpp
template <typename T>
@ -148,7 +148,7 @@ const_reference operator*() const
Const reference of type `T` and asserts `etl::typed_storage_error` if `has_value()` is `false`.
## is_aligned
Since: `20.35.12`
From: `20.35.12`
```cpp
bool is_aligned(void* p, size_t alignment)
@ -173,11 +173,11 @@ bool is_aligned(void* p)
Check that `p` has the alignment of `T`.
## alignment_exception
Since: `20.35.12`
From: `20.35.12`
Exception base for alignment
---
## alignment_error
Since: `20.35.12`
From: `20.35.12`
Memory misalignment exception.

View File

@ -18,4 +18,4 @@ If a type cannot be handled by the built-ins then the types are wrapped by `etl:
If there is an ETL atomic type available for your platform then `ETL_HAS_ATOMIC` will be set to `1`, otherwise
it will be set to `0`.
Since: `20.40.0` `etl::atomic` supports the `is_always_lock_free` property.
From: `20.40.0` `etl::atomic` supports the `is_always_lock_free` property.

Some files were not shown because too many files have changed in this diff Show More