From 003e5f3c861adf0aa567d02fe678bb310ceeb090 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Tue, 19 May 2026 12:12:14 +0100 Subject: [PATCH] Multiple document updates --- docs/IO/io_port.md | 2 +- docs/Messaging/message-bus.md | 2 +- docs/Messaging/message-packet.md | 4 +- docs/Messaging/message-router-registry.md | 2 +- docs/binary/binary.md | 18 +- docs/binary/byte.md | 2 +- docs/callbacks/inplace_function.md | 2 +- docs/callbacks/signal.md | 2 +- docs/chrono/_index.md | 2 +- docs/chrono/chrono-literals.md | 2 +- docs/chrono/duration/_index.md | 2 +- docs/chrono/duration/duration_cast.md | 2 +- docs/chrono/duration/duration_values.md | 2 +- docs/chrono/hh_mm_ss.md | 2 +- docs/chrono/last_spec.md | 2 +- docs/chrono/month/_index.md | 2 +- docs/chrono/month/month.md | 2 +- docs/chrono/month/month_day.md | 2 +- docs/chrono/month/month_day_last.md | 2 +- docs/chrono/month/month_weekday.md | 2 +- docs/chrono/month/month_weekday_last.md | 2 +- docs/chrono/operators.md | 2 +- docs/chrono/time_point.md | 2 +- docs/chrono/weekday/_index.md | 2 +- docs/chrono/weekday/weekday.md | 2 +- docs/chrono/weekday/weekday_indexed.md | 2 +- docs/chrono/weekday/weekday_last.md | 2 +- docs/chrono/year/_index.md | 2 +- docs/chrono/year/year.md | 2 +- docs/chrono/year/year_month.md | 2 +- docs/chrono/year/year_month_day.md | 2 +- docs/chrono/year/year_month_day_last.md | 2 +- docs/codecs/base64.md | 2 +- docs/containers/Views/multi-span.md | 189 ++++++ docs/containers/Views/poly-span.md | 2 +- docs/containers/Views/span.md | 12 +- docs/containers/binary/_index.md | 6 + docs/containers/{ => binary}/bitset.md | 2 +- docs/containers/{ => binary}/bloom-filter.md | 2 +- docs/containers/deque.md | 8 +- docs/containers/imemory-block-allocator.md | 84 +++ docs/containers/indirect-vector.md | 627 +++++++++++++++++- docs/containers/intrusive-list.md | 345 ++++++++++ docs/containers/list.md | 24 +- docs/containers/maps/flat-map.md | 40 +- docs/containers/multi-vector.md | 30 + docs/containers/{ => pools}/variant-pool.md | 0 docs/containers/queues/circular-buffer.md | 6 +- docs/containers/sets/_index.md | 6 + docs/containers/{ => sets}/const-multiset.md | 0 docs/containers/{ => sets}/const-set.md | 0 docs/containers/sets/flat_set.md | 494 ++++++++++++++ docs/containers/vector.md | 12 +- .../enabling-compiler-built-ins.md | 2 +- docs/iterators/circular_iterator.md | 2 +- docs/maths/Invert.md | 2 +- docs/maths/correlation.md | 2 +- docs/maths/covariance.md | 2 +- docs/maths/gamma.md | 2 +- docs/maths/histogram.md | 2 +- docs/maths/limiter.md | 2 +- docs/maths/mean.md | 2 +- docs/maths/quantize.md | 2 +- docs/maths/rescale.md | 2 +- docs/maths/rms.md | 2 +- docs/maths/rounded-integral-division.md | 2 +- docs/maths/standard_deviation.md | 2 +- docs/maths/threshold.md | 2 +- docs/patterns/overload.md | 2 +- docs/patterns/visitor.md | 4 +- docs/queue_lockable.md | 174 ----- docs/raw/containers/Intrusive Links.txt | 279 -------- docs/raw/containers/flat_map.txt | 256 ------- docs/raw/containers/flat_set.txt | 234 ------- .../containers/imemory_block_allocator.txt | 42 -- docs/raw/containers/indirect_vector.txt | 314 --------- docs/raw/containers/intrusive_list.txt | 159 ----- docs/raw/containers/multi_span.txt | 99 --- docs/raw/containers/multi_vector.txt | 27 - docs/state machines/finite-state-machine.md | 2 +- .../hierarchical-finite-state-machine.md | 2 +- docs/state machines/state-chart.md | 4 +- docs/strings/string.md | 20 +- docs/strings/to_string.md | 4 +- docs/timers/callback-timer-atomic.md | 6 +- docs/timers/callback-timer-deferred-locked.md | 4 +- docs/timers/callback-timer-interrupt.md | 4 +- docs/timers/callback-timer-locked.md | 2 +- docs/timers/callback-timer.md | 2 +- docs/timers/message-timer-atomic.md | 4 +- docs/timers/message-timer-interrupt.md | 4 +- docs/timers/message-timer-locked.md | 2 +- docs/timers/message-timer.md | 2 +- docs/types/tuple.md | 2 +- docs/types/type-list.md | 6 +- docs/types/type-traits.md | 20 +- docs/types/unaligned-type.md | 2 +- docs/utilities/algorithms.md | 4 +- docs/utilities/alignment.md | 8 +- docs/utilities/atomic.md | 2 +- docs/utilities/byte-stream-reader.md | 6 +- docs/utilities/byte_stream_writer.md | 10 +- docs/utilities/expected.md | 4 +- docs/utilities/functional.md | 16 +- docs/utilities/initializer-list.md | 2 +- docs/utilities/instance-count.md | 2 +- docs/utilities/intrusive-links.md | 479 +++++++++++++ docs/utilities/mem_cast.md | 2 +- docs/utilities/memory.md | 18 +- docs/utilities/not-null.md | 2 +- docs/utilities/nullptr.md | 2 +- docs/utilities/result.md | 2 +- docs/utilities/utility.md | 26 +- 113 files changed, 2470 insertions(+), 1800 deletions(-) create mode 100644 docs/containers/Views/multi-span.md create mode 100644 docs/containers/binary/_index.md rename docs/containers/{ => binary}/bitset.md (99%) rename docs/containers/{ => binary}/bloom-filter.md (97%) create mode 100644 docs/containers/imemory-block-allocator.md create mode 100644 docs/containers/intrusive-list.md create mode 100644 docs/containers/multi-vector.md rename docs/containers/{ => pools}/variant-pool.md (100%) create mode 100644 docs/containers/sets/_index.md rename docs/containers/{ => sets}/const-multiset.md (100%) rename docs/containers/{ => sets}/const-set.md (100%) create mode 100644 docs/containers/sets/flat_set.md delete mode 100644 docs/queue_lockable.md delete mode 100644 docs/raw/containers/Intrusive Links.txt delete mode 100644 docs/raw/containers/flat_map.txt delete mode 100644 docs/raw/containers/flat_set.txt delete mode 100644 docs/raw/containers/imemory_block_allocator.txt delete mode 100644 docs/raw/containers/indirect_vector.txt delete mode 100644 docs/raw/containers/intrusive_list.txt delete mode 100644 docs/raw/containers/multi_span.txt delete mode 100644 docs/raw/containers/multi_vector.txt create mode 100644 docs/utilities/intrusive-links.md diff --git a/docs/IO/io_port.md b/docs/IO/io_port.md index ca36f401..67d4d70e 100644 --- a/docs/IO/io_port.md +++ b/docs/IO/io_port.md @@ -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. diff --git a/docs/Messaging/message-bus.md b/docs/Messaging/message-bus.md index 222f665a..ad88030d 100644 --- a/docs/Messaging/message-bus.md +++ b/docs/Messaging/message-bus.md @@ -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 diff --git a/docs/Messaging/message-packet.md b/docs/Messaging/message-packet.md index 5854bfab..d027aaed 100644 --- a/docs/Messaging/message-packet.md +++ b/docs/Messaging/message-packet.md @@ -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` --- diff --git a/docs/Messaging/message-router-registry.md b/docs/Messaging/message-router-registry.md index 4066e060..79c09fb9 100644 --- a/docs/Messaging/message-router-registry.md +++ b/docs/Messaging/message-router-registry.md @@ -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. diff --git a/docs/binary/binary.md b/docs/binary/binary.md index 61088439..bfa6de23 100644 --- a/docs/binary/binary.md +++ b/docs/binary/binary.md @@ -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::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(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() == 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::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() == 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 struct binary_not : public etl::unary_function; ``` -Since: `20.38.11` +From: `20.38.11` --- @@ -494,7 +494,7 @@ T operator(T value) template struct binary_and : public etl::unary_function; ``` -Since: `20.38.11` +From: `20.38.11` --- @@ -520,7 +520,7 @@ T operator(T value) template struct binary_or : public etl::unary_function; ``` -Since: `20.38.11` +From: `20.38.11` --- @@ -546,7 +546,7 @@ T operator(T value) template struct binary_xor : public etl::unary_function; ``` -Since: `20.38.11` +From: `20.38.11` --- diff --git a/docs/binary/byte.md b/docs/binary/byte.md index a0f8b499..0e878b3e 100644 --- a/docs/binary/byte.md +++ b/docs/binary/byte.md @@ -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 >}} diff --git a/docs/callbacks/inplace_function.md b/docs/callbacks/inplace_function.md index e68c09d5..6e675a54 100644 --- a/docs/callbacks/inplace_function.md +++ b/docs/callbacks/inplace_function.md @@ -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 >}} diff --git a/docs/callbacks/signal.md b/docs/callbacks/signal.md index 2046e892..a8c19efc 100644 --- a/docs/callbacks/signal.md +++ b/docs/callbacks/signal.md @@ -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. diff --git a/docs/chrono/_index.md b/docs/chrono/_index.md index 7b4d7c22..fe9d948c 100644 --- a/docs/chrono/_index.md +++ b/docs/chrono/_index.md @@ -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 >}} \ No newline at end of file diff --git a/docs/chrono/chrono-literals.md b/docs/chrono/chrono-literals.md index 3c6e701d..76b3ed5e 100644 --- a/docs/chrono/chrono-literals.md +++ b/docs/chrono/chrono-literals.md @@ -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 >}} diff --git a/docs/chrono/duration/_index.md b/docs/chrono/duration/_index.md index 551efac1..f41bb632 100644 --- a/docs/chrono/duration/_index.md +++ b/docs/chrono/duration/_index.md @@ -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 >}} diff --git a/docs/chrono/duration/duration_cast.md b/docs/chrono/duration/duration_cast.md index dde0a380..c75f1166 100644 --- a/docs/chrono/duration/duration_cast.md +++ b/docs/chrono/duration/duration_cast.md @@ -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 >}} diff --git a/docs/chrono/duration/duration_values.md b/docs/chrono/duration/duration_values.md index 274d73e7..1373458e 100644 --- a/docs/chrono/duration/duration_values.md +++ b/docs/chrono/duration/duration_values.md @@ -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 >}} diff --git a/docs/chrono/hh_mm_ss.md b/docs/chrono/hh_mm_ss.md index 7c5eafc9..f7744ff1 100644 --- a/docs/chrono/hh_mm_ss.md +++ b/docs/chrono/hh_mm_ss.md @@ -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 >}} diff --git a/docs/chrono/last_spec.md b/docs/chrono/last_spec.md index e8c38680..cc6d2a2b 100644 --- a/docs/chrono/last_spec.md +++ b/docs/chrono/last_spec.md @@ -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 >}} diff --git a/docs/chrono/month/_index.md b/docs/chrono/month/_index.md index ec5d5d7b..d62bb8c3 100644 --- a/docs/chrono/month/_index.md +++ b/docs/chrono/month/_index.md @@ -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 >}} diff --git a/docs/chrono/month/month.md b/docs/chrono/month/month.md index 77348010..064266fc 100644 --- a/docs/chrono/month/month.md +++ b/docs/chrono/month/month.md @@ -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 >}} diff --git a/docs/chrono/month/month_day.md b/docs/chrono/month/month_day.md index 3b2f939b..ccabdc33 100644 --- a/docs/chrono/month/month_day.md +++ b/docs/chrono/month/month_day.md @@ -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 >}} diff --git a/docs/chrono/month/month_day_last.md b/docs/chrono/month/month_day_last.md index c965c24d..32733195 100644 --- a/docs/chrono/month/month_day_last.md +++ b/docs/chrono/month/month_day_last.md @@ -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 >}} diff --git a/docs/chrono/month/month_weekday.md b/docs/chrono/month/month_weekday.md index 9322183f..ab73505e 100644 --- a/docs/chrono/month/month_weekday.md +++ b/docs/chrono/month/month_weekday.md @@ -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 >}} diff --git a/docs/chrono/month/month_weekday_last.md b/docs/chrono/month/month_weekday_last.md index 6243d966..4af59d1d 100644 --- a/docs/chrono/month/month_weekday_last.md +++ b/docs/chrono/month/month_weekday_last.md @@ -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 >}} diff --git a/docs/chrono/operators.md b/docs/chrono/operators.md index 0a98ab6f..719afea0 100644 --- a/docs/chrono/operators.md +++ b/docs/chrono/operators.md @@ -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 >}} diff --git a/docs/chrono/time_point.md b/docs/chrono/time_point.md index bbf12439..3a9ec057 100644 --- a/docs/chrono/time_point.md +++ b/docs/chrono/time_point.md @@ -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 >}} diff --git a/docs/chrono/weekday/_index.md b/docs/chrono/weekday/_index.md index 5fc8b7c3..ef7a2c81 100644 --- a/docs/chrono/weekday/_index.md +++ b/docs/chrono/weekday/_index.md @@ -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 >}} diff --git a/docs/chrono/weekday/weekday.md b/docs/chrono/weekday/weekday.md index 0118dfca..70cf2e06 100644 --- a/docs/chrono/weekday/weekday.md +++ b/docs/chrono/weekday/weekday.md @@ -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 >}} diff --git a/docs/chrono/weekday/weekday_indexed.md b/docs/chrono/weekday/weekday_indexed.md index 33c508e5..4062e3cc 100644 --- a/docs/chrono/weekday/weekday_indexed.md +++ b/docs/chrono/weekday/weekday_indexed.md @@ -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 >}} diff --git a/docs/chrono/weekday/weekday_last.md b/docs/chrono/weekday/weekday_last.md index e6598627..d1219e57 100644 --- a/docs/chrono/weekday/weekday_last.md +++ b/docs/chrono/weekday/weekday_last.md @@ -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 >}} diff --git a/docs/chrono/year/_index.md b/docs/chrono/year/_index.md index 3d069ee1..bc9b9e27 100644 --- a/docs/chrono/year/_index.md +++ b/docs/chrono/year/_index.md @@ -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 >}} diff --git a/docs/chrono/year/year.md b/docs/chrono/year/year.md index 311dad83..9d409d4a 100644 --- a/docs/chrono/year/year.md +++ b/docs/chrono/year/year.md @@ -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 >}} diff --git a/docs/chrono/year/year_month.md b/docs/chrono/year/year_month.md index 0d5998f5..9c271073 100644 --- a/docs/chrono/year/year_month.md +++ b/docs/chrono/year/year_month.md @@ -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 >}} diff --git a/docs/chrono/year/year_month_day.md b/docs/chrono/year/year_month_day.md index 5c99ce3b..728971de 100644 --- a/docs/chrono/year/year_month_day.md +++ b/docs/chrono/year/year_month_day.md @@ -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 >}} diff --git a/docs/chrono/year/year_month_day_last.md b/docs/chrono/year/year_month_day_last.md index 71a52519..426a51ab 100644 --- a/docs/chrono/year/year_month_day_last.md +++ b/docs/chrono/year/year_month_day_last.md @@ -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 >}} diff --git a/docs/codecs/base64.md b/docs/codecs/base64.md index 96102871..e76f0040 100644 --- a/docs/codecs/base64.md +++ b/docs/codecs/base64.md @@ -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. diff --git a/docs/containers/Views/multi-span.md b/docs/containers/Views/multi-span.md new file mode 100644 index 00000000..0c2fd2ed --- /dev/null +++ b/docs/containers/Views/multi-span.md @@ -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 +``` +Where `T` is the element type of the spans. + +## Member types + +```cpp +element_type T +value_type remove_cv::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 +const_reverse_iterator ETL_OR_STD::reverse_iterator + +span_type etl::span +span_list_type etl::span +``` + +## Constructors + +ETL_CONSTEXPR multi_span(span_list_type span_list) +**Description** +Construct from a span of spans. + +--- + +template +ETL_CONSTEXPR multi_span(TContainer& a) ETL_NOEXCEPT +**Description** +Construct from a container of spans. + +--- + +template +ETL_CONSTEXPR multi_span(const TContainer& a) ETL_NOEXCEPT +**Description** +Construct from a const container of spans. + +--- + +template +ETL_CONSTEXPR multi_span(TIterator begin, TIterator end) +**Description** +Construct from a range of spans. + +--- + +template +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. diff --git a/docs/containers/Views/poly-span.md b/docs/containers/Views/poly-span.md index 26dc55bc..376c35ef 100644 --- a/docs/containers/Views/poly-span.md +++ b/docs/containers/Views/poly-span.md @@ -4,7 +4,7 @@ title: "poly_span" {{< callout >}} Header: `poly_span.h` - Since: `20.31.0` + From: `20.31.0` {{< /callout >}} Polymorphic span. diff --git a/docs/containers/Views/span.md b/docs/containers/Views/span.md index fe4b30ed..8fb131f7 100644 --- a/docs/containers/Views/span.md +++ b/docs/containers/Views/span.md @@ -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& lhs, const etl::span& 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& lhs, const etl::span& 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 diff --git a/docs/containers/binary/_index.md b/docs/containers/binary/_index.md new file mode 100644 index 00000000..43f202a7 --- /dev/null +++ b/docs/containers/binary/_index.md @@ -0,0 +1,6 @@ +--- +title: "Binary" +weight: 100 +--- + +Binary like containers. \ No newline at end of file diff --git a/docs/containers/bitset.md b/docs/containers/binary/bitset.md similarity index 99% rename from docs/containers/bitset.md rename to docs/containers/binary/bitset.md index f7ff61d8..7a9c6329 100644 --- a/docs/containers/bitset.md +++ b/docs/containers/binary/bitset.md @@ -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 diff --git a/docs/containers/bloom-filter.md b/docs/containers/binary/bloom-filter.md similarity index 97% rename from docs/containers/bloom-filter.md rename to docs/containers/binary/bloom-filter.md index 048bbb1d..828b0313 100644 --- a/docs/containers/bloom-filter.md +++ b/docs/containers/binary/bloom-filter.md @@ -13,7 +13,7 @@ etl::bloom_filter diff --git a/docs/containers/imemory-block-allocator.md b/docs/containers/imemory-block-allocator.md new file mode 100644 index 00000000..7843daf2 --- /dev/null +++ b/docs/containers/imemory-block-allocator.md @@ -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`. + +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. + diff --git a/docs/containers/indirect-vector.md b/docs/containers/indirect-vector.md index 3a8ab82f..0589b0a1 100644 --- a/docs/containers/indirect-vector.md +++ b/docs/containers/indirect-vector.md @@ -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 +etl::indirect_vector_ext +``` + +Inherits from `etl::iindirect_vector`. +`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 +``` +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 +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 +const_reverse_iterator std::reverse_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 +class unary_function_adaptor +``` + +--- + +```cpp +template +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 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; +Vector v; + +// std::less wrapped in a binary_function_adaptor. +using LessThan = typename Vector::binary_function_adaptor, 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() +etl::indirect_vector(size_t initialSize) +etl::indirect_vector(size_t initialSize, const T& value) + +template +etl::indirect_vector(TIterator begin, TIterator end) + +etl::indirect_vector(const etl::indirect_vector&) +etl::indirect_vector(etl::indirect_vector&&) +``` +**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(etl::ivector& lookup, etl::ipool& storage) +etl::indirect_vector(size_t initialSize, etl::ivector& lookup, etl::ipool& storage) +etl::indirect_vector(size_t initialSize, const T& value, etl::ivector& lookup, etl::ipool& storage) + +template +etl::indirect_vector(TIterator begin, TIterator end, etl::ivector& lookup, etl::ipool& storage) + +etl::indirect_vector(const etl::indirect_vector&, etl::ivector& lookup, etl::ipool& storage) + +etl::indirect_vector(etl::indirect_vector&&, etl::ivector& 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 +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 +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 +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 +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 +void insert(iterator position, TIterator begin, TIterator end) +``` +**Description** +Insert the range [`begin`, `end`) at `position`. +Before: `20.19.0` + +--- + +```cpp +template +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 +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 +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 +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 +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 +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`. diff --git a/docs/containers/intrusive-list.md b/docs/containers/intrusive-list.md new file mode 100644 index 00000000..a58cad9a --- /dev/null +++ b/docs/containers/intrusive-list.md @@ -0,0 +1,345 @@ +--- +title: "intrusive_list" +--- + +{{< callout type="info">}} + Header: `intrusive_list.h` + Similar to: `std::list` +{{< /callout >}} + +An intrusive list. + +```cpp +template +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() +``` + +--- + +```cpp +template +etl::intrusive_list(TIterator begin, TIterator end) +``` +**Description** +Default constructor. + +--- + +```cpp +template +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 +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 +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 +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 +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 +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 +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 +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`. diff --git a/docs/containers/list.md b/docs/containers/list.md index 6bdaba55..5423444b 100644 --- a/docs/containers/list.md +++ b/docs/containers/list.md @@ -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` --- diff --git a/docs/containers/maps/flat-map.md b/docs/containers/maps/flat-map.md index 9f2564e9..dd1d1850 100644 --- a/docs/containers/maps/flat-map.md +++ b/docs/containers/maps/flat-map.md @@ -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... 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 pair 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 @@ -278,6 +280,8 @@ pair 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 @@ -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 pair equal_range(const K& key) @@ -439,7 +441,7 @@ pair 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 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 diff --git a/docs/containers/multi-vector.md b/docs/containers/multi-vector.md new file mode 100644 index 00000000..76712af4 --- /dev/null +++ b/docs/containers/multi-vector.md @@ -0,0 +1,30 @@ +--- +title: "multi_vector" +--- + +A fixed capacity multi-dimensional vector. + +For C++11 or greater only. + +```cpp +etl::multi_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 + +```cpp +etl::multi_vector +``` + +is equivalent to + +```cpp +etl::vector, 3>, 2> +``` + +Each dimension of an `etl::multi_vector` supports all of the members of an `etl::vector`. diff --git a/docs/containers/variant-pool.md b/docs/containers/pools/variant-pool.md similarity index 100% rename from docs/containers/variant-pool.md rename to docs/containers/pools/variant-pool.md diff --git a/docs/containers/queues/circular-buffer.md b/docs/containers/queues/circular-buffer.md index cfc1b656..389f5910 100644 --- a/docs/containers/queues/circular-buffer.md +++ b/docs/containers/queues/circular-buffer.md @@ -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` --- diff --git a/docs/containers/sets/_index.md b/docs/containers/sets/_index.md new file mode 100644 index 00000000..f0c8eb1b --- /dev/null +++ b/docs/containers/sets/_index.md @@ -0,0 +1,6 @@ +--- +title: "Sets" +weight: 100 +--- + +Set like containers. \ No newline at end of file diff --git a/docs/containers/const-multiset.md b/docs/containers/sets/const-multiset.md similarity index 100% rename from docs/containers/const-multiset.md rename to docs/containers/sets/const-multiset.md diff --git a/docs/containers/const-set.md b/docs/containers/sets/const-set.md similarity index 100% rename from docs/containers/const-set.md rename to docs/containers/sets/const-set.md diff --git a/docs/containers/sets/flat_set.md b/docs/containers/sets/flat_set.md new file mode 100644 index 00000000..3c1a5e91 --- /dev/null +++ b/docs/containers/sets/flat_set.md @@ -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 +``` + +Inherits from `etl::iflat_set`. +`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 +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 > +constexpr auto make_flat_set(TValues&&... values) +``` + +### Example +```cpp +auto data = etl::make_flat_set({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 +const_reverse_iterator reverse_iterator +``` + +## Static Constants + +`MAX_SIZE` The maximum size of the flat set. + +## Constructors + +```cpp +etl::flat_set() +``` +**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 +etl::flat_set(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 insert(const_reference value) +pair 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 +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 emplace((const_reference value)) +pair 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 +pair emplace(const key_type& key, const T1& value1) +``` +**Description** +Emplaces a value constructed from `key` and 1 argument into the set. + +```cpp +template +pair 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 +pair 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 +pair 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 +pair 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 +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 equal_range(key_value_parameter_t key) +pair 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 +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 +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 +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 +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 +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 +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 +pair 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 +pair 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 +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. diff --git a/docs/containers/vector.md b/docs/containers/vector.md index f7981f90..8ff8d28b 100644 --- a/docs/containers/vector.md +++ b/docs/containers/vector.md @@ -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 void emplace_back(Args&&... args) ``` -Since: `20.35.10` +From: `20.35.10` ```cpp template 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 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` --- diff --git a/docs/getting-started/enabling-compiler-built-ins.md b/docs/getting-started/enabling-compiler-built-ins.md index 93050ffd..26613574 100644 --- a/docs/getting-started/enabling-compiler-built-ins.md +++ b/docs/getting-started/enabling-compiler-built-ins.md @@ -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`. diff --git a/docs/iterators/circular_iterator.md b/docs/iterators/circular_iterator.md index 5a824224..742f8c8d 100644 --- a/docs/iterators/circular_iterator.md +++ b/docs/iterators/circular_iterator.md @@ -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. diff --git a/docs/maths/Invert.md b/docs/maths/Invert.md index 52bc9674..2e078413 100644 --- a/docs/maths/Invert.md +++ b/docs/maths/Invert.md @@ -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. diff --git a/docs/maths/correlation.md b/docs/maths/correlation.md index 4b47f177..7dfdae2f 100644 --- a/docs/maths/correlation.md +++ b/docs/maths/correlation.md @@ -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. diff --git a/docs/maths/covariance.md b/docs/maths/covariance.md index 9151e66d..421886bd 100644 --- a/docs/maths/covariance.md +++ b/docs/maths/covariance.md @@ -4,7 +4,7 @@ title: "Covariance" {{< callout type="info">}} Header: `covariance.h` - Since: `20.9.0` + From: `20.9.0` {{< /callout >}} ```cpp diff --git a/docs/maths/gamma.md b/docs/maths/gamma.md index c014646b..df76ca31 100644 --- a/docs/maths/gamma.md +++ b/docs/maths/gamma.md @@ -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`. diff --git a/docs/maths/histogram.md b/docs/maths/histogram.md index 63863bfa..ae96c354 100644 --- a/docs/maths/histogram.md +++ b/docs/maths/histogram.md @@ -4,7 +4,7 @@ title: "Histgram" {{< callout type="info">}} Header: `histogram.h` - Since: `20.9.0` + From: `20.9.0` {{< /callout >}} ## Member types diff --git a/docs/maths/limiter.md b/docs/maths/limiter.md index 40ad7961..f2d737c6 100644 --- a/docs/maths/limiter.md +++ b/docs/maths/limiter.md @@ -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. diff --git a/docs/maths/mean.md b/docs/maths/mean.md index 09150d9a..1d99b9cc 100644 --- a/docs/maths/mean.md +++ b/docs/maths/mean.md @@ -4,7 +4,7 @@ title: "mean" {{< callout type="info">}} Header: `mean.h` - Since: `20.9.0` + From: `20.9.0` {{< /callout >}} ```cpp diff --git a/docs/maths/quantize.md b/docs/maths/quantize.md index 899496fc..16703dea 100644 --- a/docs/maths/quantize.md +++ b/docs/maths/quantize.md @@ -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. diff --git a/docs/maths/rescale.md b/docs/maths/rescale.md index 7ee56b8c..21709639 100644 --- a/docs/maths/rescale.md +++ b/docs/maths/rescale.md @@ -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. diff --git a/docs/maths/rms.md b/docs/maths/rms.md index 86a72476..0596fd79 100644 --- a/docs/maths/rms.md +++ b/docs/maths/rms.md @@ -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 diff --git a/docs/maths/rounded-integral-division.md b/docs/maths/rounded-integral-division.md index ac161a08..1a293147 100644 --- a/docs/maths/rounded-integral-division.md +++ b/docs/maths/rounded-integral-division.md @@ -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. diff --git a/docs/maths/standard_deviation.md b/docs/maths/standard_deviation.md index fe930b3d..3eb6490d 100644 --- a/docs/maths/standard_deviation.md +++ b/docs/maths/standard_deviation.md @@ -4,7 +4,7 @@ title: "standard_deviation" {{< callout type="info">}} Header: `standard_deviation.h` - Since: `20.9.0` + From: `20.9.0` {{< /callout >}} ```cpp diff --git a/docs/maths/threshold.md b/docs/maths/threshold.md index 59c4cf68..ae98ec52 100644 --- a/docs/maths/threshold.md +++ b/docs/maths/threshold.md @@ -4,7 +4,7 @@ title: "threshold" {{< callout type="info">}} Header: `threshold.h` - Since: `20.9.0` + From: `20.9.0` {{< /callout >}} ```cpp diff --git a/docs/patterns/overload.md b/docs/patterns/overload.md index f9034a6c..da601556 100644 --- a/docs/patterns/overload.md +++ b/docs/patterns/overload.md @@ -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** diff --git a/docs/patterns/visitor.md b/docs/patterns/visitor.md index 7c24dcc9..50c65239 100644 --- a/docs/patterns/visitor.md +++ b/docs/patterns/visitor.md @@ -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 @@ -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 diff --git a/docs/queue_lockable.md b/docs/queue_lockable.md deleted file mode 100644 index 4f17df2a..00000000 --- a/docs/queue_lockable.md +++ /dev/null @@ -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 -``` - -Inherits from `etl::iqueue_lockable`. -`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 -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 lock; -etl::function_imv unlock; - -etl::queue_spsc_locked queue(lock, unlock); - -int main() -{ - while (true) - { - char c; - - if (queue.pop(c)) - { - Print(c); - } - } -} - -void ISR(char c) -{ - queue.push_from_unlocked(c); -} -``` diff --git a/docs/raw/containers/Intrusive Links.txt b/docs/raw/containers/Intrusive Links.txt deleted file mode 100644 index ee7b6753..00000000 --- a/docs/raw/containers/Intrusive Links.txt +++ /dev/null @@ -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 -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* etl_next A pointer to the next forward link at this level. -____________________________________________________________________________________________________ -Public functions -clear() Clears the pointers to nullptr. -____________________________________________________________________________________________________ -Link functions - -template -struct is_forward_link - -template -inline constexpr bool is_forward_link_v; -C++17 - -// link -template -void link(TLink& lhs, TLink& rhs) - -template -void link(TLink* lhs, TLink* rhs) - -template -void link(TLink& lhs, TLink* rhs) - -template -void link(TLink* lhs, TLink& rhs) - - // link_splice -template -void link_splice(TLink& lhs, TLink& rhs) - -template -void link_splice(TLink* lhs, TLink* rhs) - -template -void link_splice(TLink& lhs, TLink* rhs) - -template -void link_splice(TLink* lhs, TLink& rhs) - -template -void link_splice(TLink& lhs, TLink& first, TLink& last) - -template -void link_splice(TLink* lhs, TLink& first, TLink& last) - -// unlink_after -template -TLink* unlink_after(TLink& node) - -template -TLink* unlink_after(TLink& before, TLink& last) - -// is_linked -template -bool is_linked(TLink& node) - -template -bool is_linked(TLink* node) - -// link_clear -template -void link_clear(TLink& start) - -template -void link_clear(TLink* start) - -// link_clear_range -template -void link_clear_range(TLink& start) - -template -void link_clear_range(TLink* start) - -// create_linked_list -template -TLink* create_linked_list(TLink& first, TLinks&... links) -Create a linked list from a number of forward_link nodes. - -// detach_linked_list -template -void detach_linked_list(TLink& first) - -template -void detach_linked_list(TLink* first) -____________________________________________________________________________________________________ -Link test -20.37.0 -template -etl::is_forward_link -Tests if type T is an etl::is_forward_link - -template -etl::is_forward_link_v -From C++17 -____________________________________________________________________________________________________ -Bidirectional link -template -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* etl_previous A pointer to the previous bidirectional link at this level. -bidirectional_link* 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(lhs, rhs) -Link lhs to rhs. - -void etl::link_splice(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(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 -etl::is_bidirectional_link -Tests if type T is an etl::is_bidirectional_link - -template -etl::is_bidirectional_link_v -From C++17 -____________________________________________________________________________________________________ -Tree link -template -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* etl_parent A pointer to the parent tree link at this level. -tree_link* etl_left A pointer to the left tree link at this level. -tree_link* 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(parent, leaf) Links leaf to the left of parent. -void etl::link_right(parent, leaf) Links leaf to the right of parent. - -void etl::link_rotate_left(parent, leaf) Rotates the link left making leaf the new parent. -void etl::link_rotate_right(parent, leaf) Rotates the link right making leaf the new parent. - -void etl::link_rotate(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 -etl::is_tree_link -Tests if type T is an etl::is_tree_link - -template -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; - -// 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 level0_list; -etl::intrusive_list 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(data0, data1); -etl::link(data1, data2); -etl::link(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(data2, data3); -etl::link(data3, data0); -etl::link(data0, data1); // Level 1 = data2, data3, data0, data1 - -// Disconnect a node. -etl::unlink(data3); // Level 1 = data2, data0, data1 -TLink*TLink* diff --git a/docs/raw/containers/flat_map.txt b/docs/raw/containers/flat_map.txt deleted file mode 100644 index b83eb028..00000000 --- a/docs/raw/containers/flat_map.txt +++ /dev/null @@ -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 - -Inherits from etl::iflat_map -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 -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... TPairs> -constexpr auto make_flat_map(TValues&&... values) - -Example -auto data = etl::make_flat_map(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 - 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 -const_reverse_iterator reverse_iterator - -____________________________________________________________________________________________________ -Static Constants - -MAX_SIZE The maximum size of the flat map. -____________________________________________________________________________________________________ -Constructor - -etl::flat_map(); - -etl::flat_map(const flat_map& other) -etl::flat_map(flat_map&& other) - -template -etl::flat_map(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 insert(const value_type& value) -pair insert(value_type&& value) -iterator insert(iterator position, const value_type& value) -iterator insert(iterator position, value_type&& value) - -template -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 emplace((const value_type& value)) -pair 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 -pair emplace(const key_type& key, const T1& value1) - -template -pair emplace(const key_type& key, const T1& value1, const T2& value2) - -template -pair emplace(const key_type& key, const T1& value1, const T2& value2, const T3& value3) - -template -pair 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 -pair 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 -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 equal_range(key_value_parameter_t key) -pair 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 -iterator find(const K& key) - -template -const_iterator find(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -iterator lower_bound(const K& key) - -template -const_iterator lower_bound(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -iterator upper_bound(const K& key) - -template -const_iterator upper_bound(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -pair equal_range(const K& key) - -template -pair 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 -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. -________________________________________________________________________________________________________________________________________________________________________________________________________ diff --git a/docs/raw/containers/flat_set.txt b/docs/raw/containers/flat_set.txt deleted file mode 100644 index d3dae354..00000000 --- a/docs/raw/containers/flat_set.txt +++ /dev/null @@ -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 - -Inherits from etl::iflat_set -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 -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... TPairs> -constexpr auto make_flat_set(TValues&&... values) - -Example -auto data = etl::make_flat_set(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 -const_reverse_iterator reverse_iterator - -____________________________________________________________________________________________________ -Static Constants - -MAX_SIZE The maximum size of the flat set. -____________________________________________________________________________________________________ -Constructor - -etl::flat_set(); - -etl::flat_set(const flat_set& other) -etl::flat_set(flat_set&&) - -template -etl::flat_set(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 insert(const_reference value) -iterator insert(iterator position, const_reference value) -pair insert(rvalue_reference value) -iterator insert(iterator position, rvalue_reference value) - -template -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 emplace(parameter_t value) -Inserts a value into the map by constructing directly into storage. -____________________________________________________________________________________________________ -C++03 -template -pair emplace(const T1& value1) - -template -pair emplace(const T1& value1, const T2& value2) - -template -pair emplace(const T1& value1, const T2& value2, const T3& value3) - -template -pair 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 -pair 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 -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 equal_range(parameter_t key) -pair equal_range(parameter_t key) const -____________________________________________________________________________________________________20.21.0 -C++11 or above -For comparators that define is_transparent. - -template -iterator find(const K& key) - -template -const_iterator find(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -iterator lower_bound(const K& key) - -template -const_iterator lower_bound(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -iterator upper_bound(const K& key) - -template -const_iterator upper_bound(const K& key) const -____________________________________________________________________________________________________ -20.21.0 -C++11 or above -template -pair equal_range(const K& key) - -template -pair 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 -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 diff --git a/docs/raw/containers/imemory_block_allocator.txt b/docs/raw/containers/imemory_block_allocator.txt deleted file mode 100644 index 5ed52eca..00000000 --- a/docs/raw/containers/imemory_block_allocator.txt +++ /dev/null @@ -1,42 +0,0 @@ -imemory_block_allocator - -The base of all memory block allocators. Inherits from traits class etl::successor. - -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 - -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? - diff --git a/docs/raw/containers/indirect_vector.txt b/docs/raw/containers/indirect_vector.txt deleted file mode 100644 index 1065274f..00000000 --- a/docs/raw/containers/indirect_vector.txt +++ /dev/null @@ -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 -etl::indirect_vector_ext - -Inherits from etl::iindirect_vector -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 -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 -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 -const_reverse_iterator std::reverse_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 -class unary_function_adaptor - -template -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 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; -Vector v; - -// std::less wrapped in a binary_function_adaptor. -using LessThan = typename Vector::binary_function_adaptor, 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(); -etl::indirect_vector(size_t initialSize); -etl::indirect_vector(size_t initialSize, const T& value); - -template -etl::indirect_vector(TIterator begin, TIterator end); - -etl::indirect_vector(const etl::indirect_vector&); -etl::indirect_vector(etl::indirect_vector&&); -____________________________________________________________________________________________________ -External buffer -etl::indirect_vector(etl::ivector& lookup, etl::ipool& storage); -etl::indirect_vector(size_t initialSize, etl::ivector& lookup, etl::ipool& storage); -etl::indirect_vector(size_t initialSize, const T& value, etl::ivector& lookup, etl::ipool& storage); - -template -etl::indirect_vector(TIterator begin, TIterator end, etl::ivector& lookup, etl::ipool& storage); - -etl::indirect_vector(const etl::indirect_vector&, etl::ivector& lookup, etl::ipool& storage); - -etl::indirect_vector(etl::indirect_vector&&, etl::ivector& 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 -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 -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 -void emplace_back(Args&&... args); ->=20.35.10 -template -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 -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 -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 -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 -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 -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 -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 -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. - - diff --git a/docs/raw/containers/intrusive_list.txt b/docs/raw/containers/intrusive_list.txt deleted file mode 100644 index 9e6913b0..00000000 --- a/docs/raw/containers/intrusive_list.txt +++ /dev/null @@ -1,159 +0,0 @@ -intrusive_list - -An intrusive list. -No STL equivalent. - -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 - -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(); -____________________________________________________________________________________________________ -template -etl::intrusive_list(TIterator begin, TIterator end); -____________________________________________________________________________________________________ -template -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 -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 -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 -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 -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 -void remove_if(TPredicate predicate); -Removes from the container all the elements that satisfy predicate. -____________________________________________________________________________________________________ -void unique(); - -template -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 -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. - diff --git a/docs/raw/containers/multi_span.txt b/docs/raw/containers/multi_span.txt deleted file mode 100644 index 48e6023c..00000000 --- a/docs/raw/containers/multi_span.txt +++ /dev/null @@ -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 -Where T is the element type of the spans. -____________________________________________________________________________________________________ -Member types - -element_type T -value_type remove_cv::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 -const_reverse_iterator ETL_OR_STD::reverse_iterator - -span_type etl::span -span_list_type etl::span -____________________________________________________________________________________________________ -Constructors - -ETL_CONSTEXPR multi_span(span_list_type span_list) -____________________________________________________________________________________________________ -template -ETL_CONSTEXPR multi_span(TContainer& a) ETL_NOEXCEPT -____________________________________________________________________________________________________ -template -ETL_CONSTEXPR multi_span(const TContainer& a) ETL_NOEXCEPT -____________________________________________________________________________________________________ -template -ETL_CONSTEXPR multi_span(TIterator begin, TIterator end) -____________________________________________________________________________________________________ -template -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. - diff --git a/docs/raw/containers/multi_vector.txt b/docs/raw/containers/multi_vector.txt deleted file mode 100644 index 7711a33f..00000000 --- a/docs/raw/containers/multi_vector.txt +++ /dev/null @@ -1,27 +0,0 @@ -multi_vector - -A fixed capacity multi-dimensional vector. -STL equivalent: None - -For C++11 or greater only. - -etl::multi_vector - -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 - -is equivalent to - -etl::vector, 3>, 2> - -Each dimension of an etl::multi_vector supports all of the members of an etl::vector. - diff --git a/docs/state machines/finite-state-machine.md b/docs/state machines/finite-state-machine.md index 70d3706a..ca238ed4 100644 --- a/docs/state machines/finite-state-machine.md +++ b/docs/state machines/finite-state-machine.md @@ -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. diff --git a/docs/state machines/hierarchical-finite-state-machine.md b/docs/state machines/hierarchical-finite-state-machine.md index 3d00b607..cad1b59a 100644 --- a/docs/state machines/hierarchical-finite-state-machine.md +++ b/docs/state machines/hierarchical-finite-state-machine.md @@ -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 diff --git a/docs/state machines/state-chart.md b/docs/state machines/state-chart.md index afaf3f94..948787fd 100644 --- a/docs/state machines/state-chart.md +++ b/docs/state machines/state-chart.md @@ -29,7 +29,7 @@ For C++11 or above, you may pass an rvalue reference. istate_chart ``` 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 ``` The base for all state charts. -Since: `20.23.0` +From: `20.23.0` ## Types ```cpp diff --git a/docs/strings/string.md b/docs/strings/string.md index 56793a73..48a6485c 100644 --- a/docs/strings/string.md +++ b/docs/strings/string.md @@ -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 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 make_string_with_capacity(const wchar(&text) [Size]) --- `char8_t` -Since: `20.38.7` +From: `20.38.7` ```cpp template etl::u8string make_string(const char8_t (&text) [Max_Size]) diff --git a/docs/strings/to_string.md b/docs/strings/to_string.md index e4bb45b5..a3588b91 100644 --- a/docs/strings/to_string.md +++ b/docs/strings/to_string.md @@ -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` --- diff --git a/docs/timers/callback-timer-atomic.md b/docs/timers/callback-timer-atomic.md index 07fddc4a..d648ac7f 100644 --- a/docs/timers/callback-timer-atomic.md +++ b/docs/timers/callback-timer-atomic.md @@ -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 etl::callback_timer_atomic ``` -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` diff --git a/docs/timers/callback-timer-deferred-locked.md b/docs/timers/callback-timer-deferred-locked.md index 7a2d38d5..f7763566 100644 --- a/docs/timers/callback-timer-deferred-locked.md +++ b/docs/timers/callback-timer-deferred-locked.md @@ -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` diff --git a/docs/timers/callback-timer-interrupt.md b/docs/timers/callback-timer-interrupt.md index 571c455e..37436813 100644 --- a/docs/timers/callback-timer-interrupt.md +++ b/docs/timers/callback-timer-interrupt.md @@ -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` diff --git a/docs/timers/callback-timer-locked.md b/docs/timers/callback-timer-locked.md index bdc26d25..1803ed96 100644 --- a/docs/timers/callback-timer-locked.md +++ b/docs/timers/callback-timer-locked.md @@ -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` --- diff --git a/docs/timers/callback-timer.md b/docs/timers/callback-timer.md index 7bac7945..e482f75a 100644 --- a/docs/timers/callback-timer.md +++ b/docs/timers/callback-timer.md @@ -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` diff --git a/docs/timers/message-timer-atomic.md b/docs/timers/message-timer-atomic.md index 4f2dff97..c1075b28 100644 --- a/docs/timers/message-timer-atomic.md +++ b/docs/timers/message-timer-atomic.md @@ -22,7 +22,7 @@ etl::imessage_timer_atomic etl::message_timer_atomic ``` -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` diff --git a/docs/timers/message-timer-interrupt.md b/docs/timers/message-timer-interrupt.md index f0e0a50e..30ad6f35 100644 --- a/docs/timers/message-timer-interrupt.md +++ b/docs/timers/message-timer-interrupt.md @@ -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` diff --git a/docs/timers/message-timer-locked.md b/docs/timers/message-timer-locked.md index 530ac51d..e134b09c 100644 --- a/docs/timers/message-timer-locked.md +++ b/docs/timers/message-timer-locked.md @@ -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` --- diff --git a/docs/timers/message-timer.md b/docs/timers/message-timer.md index 3d6c920b..dbfa4c70 100644 --- a/docs/timers/message-timer.md +++ b/docs/timers/message-timer.md @@ -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 diff --git a/docs/types/tuple.md b/docs/types/tuple.md index 72d08b80..695c853f 100644 --- a/docs/types/tuple.md +++ b/docs/types/tuple.md @@ -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 >}} diff --git a/docs/types/type-list.md b/docs/types/type-list.md index da8b9264..ad3fdd75 100644 --- a/docs/types/type-list.md +++ b/docs/types/type-list.md @@ -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 type_lists_are_convertible_v ``` C++17 and above. -Since: `20.43.0` +From: `20.43.0` ## Examples diff --git a/docs/types/type-traits.md b/docs/types/type-traits.md index 0ce70bc4..6bd1fcaa 100644 --- a/docs/types/type-traits.md +++ b/docs/types/type-traits.md @@ -259,7 +259,7 @@ etl::types::const_pointer_const const int* const ## unsigned_type **ETL extension** -Since: `20.29.0` +From: `20.29.0` ```cpp template @@ -278,7 +278,7 @@ C++11 ## signed_type **ETL extension** -Since: `20.29.0` +From: `20.29.0` ```cpp template @@ -303,7 +303,7 @@ C++11 template 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::value; template 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::value template 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::value; ``` ## conjunction -Since: `20.40.1` +From: `20.40.1` ```cpp template @@ -379,7 +379,7 @@ Forms the logical conjunction (AND) of `Types...` C++17 ## disjunction -Since: `20.40.1` +From: `20.40.1` ```cpp template @@ -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 @@ -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 @@ -444,7 +444,7 @@ using unwrap_ref_decay_t; C++11 ## is_specialization -Since: `20.41.0` +From: `20.41.0` ```cpp template class Template> diff --git a/docs/types/unaligned-type.md b/docs/types/unaligned-type.md index c4920da4..0f6689a9 100644 --- a/docs/types/unaligned-type.md +++ b/docs/types/unaligned-type.md @@ -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. diff --git a/docs/utilities/algorithms.md b/docs/utilities/algorithms.md index 25b06828..e87df6d3 100644 --- a/docs/utilities/algorithms.md +++ b/docs/utilities/algorithms.md @@ -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 diff --git a/docs/utilities/alignment.md b/docs/utilities/alignment.md index 47100a2e..23799366 100644 --- a/docs/utilities/alignment.md +++ b/docs/utilities/alignment.md @@ -56,7 +56,7 @@ etl::aligned_storage_as<100, double>::type storage; ``` ## typed_storage -Since: `20.40.1` +From: `20.40.1` ```cpp template @@ -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. diff --git a/docs/utilities/atomic.md b/docs/utilities/atomic.md index 0d7e12da..6319a78d 100644 --- a/docs/utilities/atomic.md +++ b/docs/utilities/atomic.md @@ -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. diff --git a/docs/utilities/byte-stream-reader.md b/docs/utilities/byte-stream-reader.md index d77c2daa..d43c3acc 100644 --- a/docs/utilities/byte-stream-reader.md +++ b/docs/utilities/byte-stream-reader.md @@ -4,7 +4,7 @@ title: "byte_stream_reader" {{< callout type="info">}} Header: `byte_stream_reader.h` - Since: `20.17.0` + From: `20.17.0` {{< /callout >}} A binary streaming utility that allows boolean, integral and floating point values to be read from an array of char or unsigned char. By default, values are stored in the byte stream in network order (Big Endian). This can be changed by specifying in the constructor. @@ -113,7 +113,7 @@ etl::optional> read(const T* start, size_t length) Read a range of `T` from the stream. **Unchecked** -Since: `20.18.0` +From: `20.18.0` The following functions will always read from the buffer. They do not check for free space. ```cpp @@ -204,7 +204,7 @@ bool skip(size_t n) Skip `n` items of `T`, if the total space is available. Returns `true` if the skip was possible. Asserts `etl::byte_stream_overflow` and returns `false` if the skip size was not possible. -Since: `20.29.1` +From: `20.29.1` --- diff --git a/docs/utilities/byte_stream_writer.md b/docs/utilities/byte_stream_writer.md index cdf18ba8..8d744532 100644 --- a/docs/utilities/byte_stream_writer.md +++ b/docs/utilities/byte_stream_writer.md @@ -4,13 +4,13 @@ title: "byte_stream_writer" {{< callout type="info">}} Header: `byte_stream_writer.h` - Since: `20.17.0` + From: `20.17.0` {{< /callout >}} A binary streaming utility that allows boolean, integral and floating point values to be written to an array of char or unsigned char. Values may be stored in the byte stream in big or little endian format. This is specified in the constructor. If a callback delegate is set, then this will be called after each write. The stream buffer indexes will be reset after every write, allowing a small buffer to be used. -Since: `20.29.0` +From: `20.29.0` ```cpp class byte_stream_writer @@ -124,7 +124,7 @@ Write a range of integral or floating point values to the stream. Returns `true` if successful, otherwise `false`. ## Unchecked -Since: `20.18.0` +From: `20.18.0` The following functions will always write to the buffer. They do not check for free space. ```cpp @@ -179,7 +179,7 @@ bool skip(size_t n) Skip `n` items of `T`, if the total space is available. Returns `true` if the skip was possible. Asserts `etl::byte_stream_overflow` and returns `false` if the skip size was not possible. -Since: `20.29.0` +From: `20.29.0` --- @@ -301,7 +301,7 @@ void set_callback(callback_type callback_) ``` **Description** Sets the delegate that is called after every write. -Since: `20.29.0` +From: `20.29.0` --- diff --git a/docs/utilities/expected.md b/docs/utilities/expected.md index 07f176da..f6cbcd63 100644 --- a/docs/utilities/expected.md +++ b/docs/utilities/expected.md @@ -4,7 +4,7 @@ title: "expected" {{< callout type="info">}} Header: `expected.h` - Since: `20.35.13` + From: `20.35.13` Similar to: `std::expected` {{< /callout >}} @@ -38,7 +38,7 @@ A constant of type `etl::unexpect_t` which is directly passed to a constructor o ```cpp inline constexpr unexpect_t unexpect; ``` -Since: C++17. +From: C++17. ```cpp static const unexpect_t unexpect; diff --git a/docs/utilities/functional.md b/docs/utilities/functional.md index d290c6cc..1fb5f6cf 100644 --- a/docs/utilities/functional.md +++ b/docs/utilities/functional.md @@ -91,7 +91,7 @@ struct less A function object that performs a strictly less-than comparison `a < b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## less_equal @@ -112,7 +112,7 @@ struct less_equal A function object that performs a strictly less-than-equal comparison `a <= b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## greater @@ -133,7 +133,7 @@ struct greater A function object that performs a strictly greater-than comparison `a > b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## greater_equal @@ -154,7 +154,7 @@ struct greater_equal A function object that performs a strictly greater-than-equal comparison `a >= b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## equal_to @@ -175,7 +175,7 @@ struct equal_to A function object that performs a strictly equal-to comparison `a == b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## not_equal_to @@ -196,7 +196,7 @@ struct not_equal_to A function object that performs a strictly not-equal-to comparison `a !== b`) between two values. Transparent comparator. Defines `is_transparent`. -Since: `20.21.0` +From: `20.21.0` ## mem_fn @@ -206,7 +206,7 @@ template ``` **Description** Returns a functor that wraps a member function of `TClassType`, taking TArgs and returning `TReturnType`. -Since: `20.38.11` +From: `20.38.11` --- @@ -216,4 +216,4 @@ template ``` **Description** Returns a functor that wraps a const member function of `TClassType`, taking TArgs and returning `TReturnType`. -Since: `20.38.11` +From: `20.38.11` diff --git a/docs/utilities/initializer-list.md b/docs/utilities/initializer-list.md index cd236c46..48cd46a1 100644 --- a/docs/utilities/initializer-list.md +++ b/docs/utilities/initializer-list.md @@ -4,7 +4,7 @@ title: "initializer_list" {{< callout type="info">}} Header: `initializer_list.h` - Since: `20.24.0` + From: `20.24.0` Similar to: [initializer_list](https://en.cppreference.com/cpp/utility/initializer_list) {{< /callout >}} diff --git a/docs/utilities/instance-count.md b/docs/utilities/instance-count.md index 97adb1f4..e8f3def6 100644 --- a/docs/utilities/instance-count.md +++ b/docs/utilities/instance-count.md @@ -14,7 +14,7 @@ etl::instance_count ``` This class is not thread safe. -Since: `20.25.0` +From: `20.25.0` ```cpp etl::instance_count ``` diff --git a/docs/utilities/intrusive-links.md b/docs/utilities/intrusive-links.md new file mode 100644 index 00000000..e3fe9780 --- /dev/null +++ b/docs/utilities/intrusive-links.md @@ -0,0 +1,479 @@ +--- +title: "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 + +```cpp +template +struct forward_link +``` + +### Template parameters +`const size_t ID_` A unique id for this link level. + +### Public constants +```cpp +enum ID +``` +**Description** +The unique id for this link level. + +### Public variables +```cpp +forward_link* etl_next +``` +**Description** +A pointer to the next forward link at this level. + +### Public functions +```cpp +clear() +``` +**Description** +Clears the pointers to nullptr. + +### Link functions + +```cpp +template +struct is_forward_link + +template +inline constexpr bool is_forward_link_v; +``` +Checks if TLink is an `etl::forward_link`. +From: C++17 + +--- + +```cpp +template +void link(TLink& lhs, TLink& rhs) + +template +void link(TLink* lhs, TLink* rhs) + +template +void link(TLink& lhs, TLink* rhs) + +template +void link(TLink* lhs, TLink& rhs) +``` +**Description** +Make `rhs` the next element after `lhs`. + +--- + +```cpp +template +void link_splice(TLink& lhs, TLink& rhs) + +template +void link_splice(TLink* lhs, TLink* rhs) + +template +void link_splice(TLink& lhs, TLink* rhs) + +template +void link_splice(TLink* lhs, TLink& rhs) +``` +**Description** +Insert `rhs` as the element after `lhs`. +The original element after `lhs` will be linked after `rhs`. + +--- + +```cpp +template +void link_splice(TLink& lhs, TLink& first, TLink& last) + +template +void link_splice(TLink* lhs, TLink& first, TLink& last) +``` +**Description** +The elements in the range [`first`, `last`] will be inserted after `lhs`. + +--- + +```cpp +template +TLink* unlink_after(TLink& node) +``` +**Description** +Unlinks the element after `node`. + +**Return** +A pointer to the removed node or `nullptr`. + +--- + +```cpp +template +TLink* unlink_after(TLink& before, TLink& last) +``` +**Description** +Unlinks the the range (`before`, `last`]. + +**Return** +A pointer to the first element in the removed range. + +--- + +```cpp +template +bool is_linked(TLink& node) + +template +bool is_linked(TLink* node) +``` +**Return** +`true` if `node` is linked to another. + +--- + +```cpp +template +void link_clear(TLink& node) + +template +void link_clear(TLink* node) +``` +**Description** +Clears the links for `node`. + +--- + +```cpp +template +void link_clear_range(TLink& start) + +template +void link_clear_range(TLink* start) +``` +**Description** +Clears the links for all nodes linked to `start`. + +--- + +```cpp +template +TLink* create_linked_list(TLink& first, TLinks&... links) +``` +**Description** +Create a linked list from a number of `forward_link` nodes. + +--- + +```cpp +template +void detach_linked_list(TLink& first) + +template +void detach_linked_list(TLink* first) +``` +**Description** +A synonym for `link_clear_range`. + +## Bidirectional link +```cpp +template +struct bidirectional_link +``` + +### Template parameters +```cpp +const size_t ID_ +``` +**Description** +The unique id for this link level. + +### Public constants +```cpp +enum ID +``` +**Description** +The unique id for this link level. + +### Public variables +```cpp +bidirectional_link* etl_previous +``` +**Description** +A pointer to the previous bidirectional link at this level. + +```cpp +bidirectional_link* etl_next +``` +**Description** +A pointer to the next bidirectional link at this level. + +### Public functions +```cpp +clear() +``` +**Description** +Clears the link pointers to `nullptr`. + +--- + +```cpp +reverse() +``` +**Description** +Reverses the order of the elements. + +### Link functions + +```cpp +void etl::link(lhs, rhs) +``` +**Description** +Link lhs to rhs. + +--- + +```cpp +void etl::link_splice(lhs, rhs) +``` +Insert `rhs` as the element after `lhs`. +The original element after `lhs` will be linked after `rhs`. + +```cpp +void etl::link_splice(lhs, first, last) +``` +**Description** +The elements in the range [`first`, `last`] will be inserted after `lhs`. + +--- + +**unlink** + +```cpp +void etl::unlink(node) +``` +**Description** +Unlink the specified node. Elements either side are linked to each other. + +```cpp +void etl::unlink(first, last) +``` +**Description** +Unlinks the range [`first`, `last`]. +The range [`first`, `last`] remain linked to each other. + +--- + +```cpp +template +etl::is_bidirectional_link +``` +**Description** +Tests if type `T` is an `etl::bidirectional_link`. + +--- + +```cpp +template +etl::is_bidirectional_link_v +``` +**Description** +Tests if type `T` is an `etl::bidirectional_link`. +From C++17 + +## Tree link +```cpp +template +struct tree_link +``` + +### Template parameters +```cpp +const size_t ID_ +``` +**Description** +A unique id for this link level. + +### Public constants +```cpp +enum ID +``` +**Description** +The unique id for this link level. + +### Public variables +```cpp +tree_link* etl_parent +``` +**Description** +A pointer to the parent tree link at this level. + +```cpp +tree_link* etl_left +``` +**Description** +A pointer to the left tree link at this level. + +```cpp +tree_link* etl_right +``` +**Description** +A pointer to the right tree link at this level. + +### Public functions +```cpp +clear() +``` +**Description** +Clears the pointers to `nullptr`. + +### Link Functions +```cpp +void etl::link_left(parent, leaf) +``` +**Description** +Links leaf to the left of parent. + +--- + +```cpp +void etl::link_right(parent, leaf) +``` +**Description** +Links leaf to the right of parent. + +--- + +```cpp +void etl::link_rotate_left(parent, leaf) +``` +**Description** +Rotates the link left making leaf the new parent. + +--- + +```cpp +void etl::link_rotate_right(parent, leaf) +``` +**Description** +Rotates the link right making leaf the new parent. + +--- + +```cpp +void etl::link_rotate(parent, leaf) +``` +**Description** +Rotates the link left or right making leaf the new parent. +Chooses left or right rotate depending on the leaf connection. + +--- + +```cpp +template +etl::is_tree_link +``` +Tests if type `T` is an `etl::tree_link`. +From: `20.37.0` + +--- + +```cpp +template +etl::is_tree_link_v +``` +Tests if type `T` is an `etl::tree_link`. +From: `20.37.0` +From: C++17 + +**Example 1** +A simple two level intrusive list. + +```cpp +// 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; + +// 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 level0_list; +etl::intrusive_list 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. + +```cpp +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(data0, data1); +etl::link(data1, data2); +etl::link(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(data2, data3); +etl::link(data3, data0); +etl::link(data0, data1); // Level 1 = data2, data3, data0, data1 + +// Disconnect a node. +etl::unlink(data3); // Level 1 = data2, data0, data1 +TLink*TLink* +``` \ No newline at end of file diff --git a/docs/utilities/mem_cast.md b/docs/utilities/mem_cast.md index f748e61e..06723434 100644 --- a/docs/utilities/mem_cast.md +++ b/docs/utilities/mem_cast.md @@ -4,7 +4,7 @@ title: "mem_cast" {{< callout type="info">}} Header: `mem_cast.h` - Since: `20.11.0` + From: `20.11.0` {{< /callout >}} Helper classes that simplify the interpretation of memory blocks. diff --git a/docs/utilities/memory.md b/docs/utilities/memory.md index 46272db1..2764d07b 100644 --- a/docs/utilities/memory.md +++ b/docs/utilities/memory.md @@ -237,7 +237,7 @@ TObject& construct_object_at(void* p, TObject&& object) Construct the object at `p`. In a debug build the pointer is checked for correct alignment. An `etl::alignment_error` is asserted if incorrect. -Since: `20.35.12` +From: `20.35.12` --- @@ -248,7 +248,7 @@ TObject& construct_object_at(void* p, TArgs&&... args) Construct the object at `p` from arguments. In a debug build the pointer is checked for correct alignment. An `etl::alignment_error` is asserted if incorrect. -Since: `20.35.12` +From: `20.35.12` --- @@ -259,7 +259,7 @@ TObject& get_object_at(void* p) Get the object at `p`. In a debug build the pointer is checked for correct alignment. An `etl::alignment_error` is asserted if incorrect. -Since: `20.35.12` +From: `20.35.12` --- @@ -269,7 +269,7 @@ void destroy_object_at(void* p) ``` Destroy the object at `p`. In a debug build the pointer is checked for correct alignment. An etl::alignment_error is asserted if incorrect. -Since: `20.35.12` +From: `20.35.12` ## uninitialzed_fill Fills uninitialised memory with N values. @@ -530,7 +530,7 @@ class uninitialized_buffer_of Creates an uninitialized memory buffer of `VN_Objects` each of type `T`. ## mem_copy -Since: `20.26.0` +From: `20.26.0` ```cpp template @@ -559,7 +559,7 @@ Type must be trivially copyable. Returns a pointer to the destination. ## mem_move -Since: `20.26.0` +From: `20.26.0` ```cpp template @@ -588,7 +588,7 @@ Type must be trivially copyable. Returns a pointer to the destination. ## mem_compare -Since: `20.26.0` +From: `20.26.0` ```cpp template @@ -616,7 +616,7 @@ Type must be trivially copyable. Returns `<0`, `0`, `>0`. See documentation for `memcmp`. ## mem_set -Since: `20.26.0` +From: `20.26.0` ```cpp template @@ -645,7 +645,7 @@ Type must be trivially copyable. Returns a pointer to the destination. ## mem_char -Since: `20.26.0` +From: `20.26.0` ```cpp template diff --git a/docs/utilities/not-null.md b/docs/utilities/not-null.md index 291eec90..5589c174 100644 --- a/docs/utilities/not-null.md +++ b/docs/utilities/not-null.md @@ -4,7 +4,7 @@ title: "not_null" {{< callout type="info">}} Header: `not_null.h` - Since: `20.43.0` + From: `20.43.0` {{< /callout >}} A container for pointers that are not allowed to be null. diff --git a/docs/utilities/nullptr.md b/docs/utilities/nullptr.md index ffb58958..dd85e701 100644 --- a/docs/utilities/nullptr.md +++ b/docs/utilities/nullptr.md @@ -12,5 +12,5 @@ Defines `ETL_NULLPTR` as either `nullptr` or `NULL`, dependent on the compiler s --- Defines `etl::nullptr_t` -Since: `20.39.0` +From: `20.39.0` diff --git a/docs/utilities/result.md b/docs/utilities/result.md index b194efb5..b50a70fe 100644 --- a/docs/utilities/result.md +++ b/docs/utilities/result.md @@ -4,7 +4,7 @@ title: "result" {{< callout type="info">}} Header: `result.h` - Since: `20.17.0` + From: `20.17.0` Similar to: `std::expected` {{< /callout >}} diff --git a/docs/utilities/utility.md b/docs/utilities/utility.md index 61886b70..eeeb2267 100644 --- a/docs/utilities/utility.md +++ b/docs/utilities/utility.md @@ -40,7 +40,7 @@ struct tuple_element> Specialisation for pair. Gets the type in the pair at `Index`. Static asserts if `Index` is not `0` or `1`. -Since: `20.40.1` +From: `20.40.1` --- @@ -133,7 +133,7 @@ C++11 ## functor For C++11 and above. -Since: `20.27.0` +From: `20.27.0` ```cpp template @@ -174,7 +174,7 @@ constexpr etl::functor f(Function); ## member_function_wrapper For C++11 and above. -Since: `20.27.0` +From: `20.27.0` ```cpp template @@ -215,7 +215,7 @@ int result = pf(1); ## functor_wrapper For C++11 and above. -Since: `20.27.0` +From: `20.27.0` ```cpp template @@ -292,7 +292,7 @@ fas_t::call(1)); ## member_function_as_static For C++17 and above. -Since: `20.40.0` +From: `20.40.0` Wraps a member function with a static free function at compile time. Creates a static member function that calls the specified member function. @@ -329,7 +329,7 @@ mfas_t::call(1)); ## member_function_as_functor For C++17 and above. -Since: `20.40.0` +From: `20.40.0` Wraps a member function with a functor at compile time. Creates a functor that calls the specified member function. @@ -364,7 +364,7 @@ mfaf(1); ## function_as_functor For C++17 and above. -Since: `20.40.0` +From: `20.40.0` Wraps a function with a functor at compile time. Creates a functor that calls the specified free function. @@ -396,7 +396,7 @@ faf(1); ## function_ptr_as_functor For C++11 and above. -Since: `20.40.0` +From: `20.40.0` Wraps a function pointer with a functor at run time. Creates a functor that calls the specified free function. @@ -435,7 +435,7 @@ constexpr etl::function_ptr_as_functor fpaf(fptr) ``` ## integer_sequence -Since: `20.14.0` +From: `20.14.0` ```cpp template @@ -443,7 +443,7 @@ class integer_sequence ``` ## index_sequence -Since: `20.14.0` +From: `20.14.0` ```cpp template @@ -465,7 +465,7 @@ A functor object that takes a single argument, a pair, and returns the `pair::fi A functor object that takes a single argument, a pair, and returns the `pair::second element`. ## size_of_type -Since: `20.36.0` +From: `20.36.0` ```cpp template @@ -491,14 +491,14 @@ ETL_SIZE_OF_OBJECT_TYPE(Object, Type) **Description** Returns the size of `Type` defined in the declared type of `Object`. C++11 and above. -Since: `20.36.0` +From: `20.36.0` ```cpp ETL_SIZE_OF_CLASS_TYPE(Class, Type) ``` **Description** Returns the size of `Type` defined in `Class`. -Since: `20.36.0` +From: `20.36.0` ---