Skip to content

Commit 7eecadb

Browse files
Switch from ESTD to ETL
1 parent 37a1388 commit 7eecadb

File tree

1,877 files changed

+801327
-51100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,877 files changed

+801327
-51100
lines changed

NOTICE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ We recommend to read their licenses, as their terms may differ from the terms de
3434

3535
| Project | Version | License | Path |
3636
|---------------------------|---------|-----------|----------------------------------------------------------------------|
37+
| ETL | 20.41.7 | MIT | ``libs/bsw/3rdparty/etl/LICENSE`` |
3738
| googletest | 1.12.1 | BSD-3 | ``libs/bsw/3rdparty/googletest/LICENSE`` |
3839
| printf | 5.2.0 | MIT | ``libs/bsw/3rdparty/printf/LICENSE`` |
3940
| FreeRTOS Real Time Kernel | 10.6.2 | MIT | ``platforms/posix/3rdparty/freeRtosPosix/LICENSE.md`` |

doc/codingGuidelines/codeFormatting/for_c++/formatting.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,10 +383,10 @@ Spaces
383383
.. code-block:: C++
384384

385385
// good
386-
estd::example<uint8_t> numbers{1, 2, 3, 4};
386+
etl::example<uint8_t> numbers{1, 2, 3, 4};
387387

388388
// bad
389-
estd::example<uint8_t> numbers{ 1, 2, 3, 4 };
389+
etl::example<uint8_t> numbers{ 1, 2, 3, 4 };
390390

391391
.. code-block::
392392
:caption: clang-format settings

doc/codingGuidelines/conventions/classes.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,24 +322,24 @@ also disable move construction:
322322
323323
324324
Before the adoption of the C++11 standard, ``UNCOPYABLE`` macro from ``estd`` library was used.
325-
Now that functions can be marked as deleted, ``estd/uncopyable.h`` is considered obsolete and should
326-
be avoided.
327325

328326

329327
Indestructible
330328
--------------
331329

332-
To avoid destructions of objects, use the ``estd::indestructible`` wrapper. The type will
330+
To avoid destructions of objects, use the ``etl::typed_storage`` wrapper. The type will
333331
become `trivially destructible
334332
<http://www.cplusplus.com/reference/type_traits/is_trivially_destructible/>`_.
335333

336334
In the following example the object of type `YourType` will be constructed with placement-new,
337335
but never destructed even when `wrapper` gets destructed. The destructor of `YourType` will never be
338-
called:
336+
called, except if you call destroy() explicitly:
339337

340338
.. code-block:: cpp
341339
342-
estd::indestructible<YourType> wrapper;
340+
etl::typed_storage<YourType> wrapper;
341+
wrapper.create();
342+
343343
344344
Avoid Protected Data
345345
--------------------

doc/codingGuidelines/conventions/enumerations.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ most cases ``uint8_t``.
8080
One advantage is that variables can now be compared with the scope resolution operator.
8181
A drawback is that there is no direct conversion from the values of a scoped enumerator to the
8282
underlying type.
83-
Use ``::estd::to_underlying`` from ``estd/type_utils.h`` to cast the enumeration value to the
83+
Use ``::etl::to_underlying`` from ``etl/utility.h`` to cast the enumeration value to the
8484
underlying type.
8585

8686
.. code-block:: cpp
8787
88-
#include <estd/type_utils.h>
88+
#include <etl/utility.h>
8989
9090
// recommended definition
9191
enum class Colors : uint8_t
@@ -104,8 +104,8 @@ underlying type.
104104
case Colors::BLUE : printf("Blue color\n"); break;
105105
}
106106
107-
// option 1: (recommended) use the estd helper function
108-
auto const colorRed = ::estd::to_underlying(Colors::RED);
107+
// option 1: (recommended) use the etl helper function
108+
auto const colorRed = ::etl::to_underlying(Colors::RED);
109109
// option 2: explicitly cast using the underlying type
110110
auto const colorGreen = static_cast<::std::underlying_type<Colors>::type>(Colors::GREEN);
111111
// option 3: explicitly cast to the specified type

doc/codingGuidelines/conventions/files.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ Standard Headers
1919
----------------
2020

2121
- See `C++ Standard Library headers <https://en.cppreference.com/w/cpp/header>`_ for details.
22-
Note, that not all includes make sense in embedded code. Some parts are replaced by our own
23-
``estd`` library.
22+
Note that not all includes make sense in embedded code. Some parts are replaced by the
23+
``etl`` library.
2424
- :rule:`FILE-010` If a file needs to be compiled for C++ and C, use the C headers.
2525
- :rule:`FILE-011` For C++ standard types, include ``<platform/estdint.h>``. It'll behave as if you
2626
included ``<cstdint>`` and ``<cstddef>`` and allow the usage of ``size_t`` directly without the

doc/codingGuidelines/conventions/functions.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ Code that uses raw byte arrays and a length are very prone to errors or misuse.
113113
void start(Connection& conn, uint8_t data[], uint16_t length);
114114
115115
It's unclear from the method signature what will happen to data and length.
116-
Look for existing buffer classes and reuse one of those, for example ``estd::array<>`` or
117-
``estd::slice<>``.
116+
Look for existing buffer classes and reuse one of those, for example ``etl::array<>`` or
117+
``etl::span<>``.
118118

119119

120120
Translation-Unit Local Functions
@@ -148,4 +148,5 @@ where we have the certainty that they are supported.
148148
When using lambdas, be careful about object lifetimes: objects captured by reference within a lambda
149149
have to be still in scope at the time of lambda execution. Also lambda objects themselves have to
150150
still exist when they're executed - it might be tricky while using function references like
151-
``estd::function``.
151+
``etl::delegate``. A solution to this issue is implemented in
152+
``etl::inplace_function``.

doc/codingGuidelines/conventions/naming.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Type Names
4848
using TcpipEventManager = ::os::EventManager<task_tcpip>;
4949
5050
Any exceptions to this rule need to have a reasonable justification and in that
51-
case should be applied consistently within a module (e.g. ``estd`` types use
51+
case should be applied consistently within a module (e.g. ``etl`` types use
5252
*snake_case* notation in order to match with their STL counterpart). In general
5353
those exceptions should be rare!
5454

@@ -184,7 +184,7 @@ does not provide any functions, you can omit the prefix.
184184
185185
class CanTransceiver // good
186186
{
187-
::estd::forward_list<ICanFrameListener> _listeners;
187+
::etl::intrusive_forward_list<ICanFrameListener, ::etl::forward_link<0>> _listeners;
188188
};
189189
190190
struct Result // good
@@ -196,7 +196,7 @@ does not provide any functions, you can omit the prefix.
196196
197197
class CanTransceiver // bad, no member prefix
198198
{
199-
::estd::forward_list<ICanFrameListener> listeners;
199+
::etl::intrusive_forward_list<ICanFrameListener, ::etl::forward_link<0>> listeners;
200200
};
201201
202202
struct Result // bad, suffix and mixed style
@@ -316,7 +316,7 @@ Boolean Variables and Functions
316316
- might need conversion if propagated to higher levels
317317

318318
Other rarely used types are `bitfields` and `ranges`. For return values of functions it is
319-
worth to look at ``::estd::result`` class which combines data and error status in one object.
319+
worth to look at ``::etl::expected`` class which combines data and error status in one object.
320320

321321
In most cases using a boolean is the best choice to keep it simple.
322322

@@ -328,7 +328,7 @@ type of the variable and the operations that can be performed on its elements.
328328

329329
.. code-block:: cpp
330330
331-
using ReceiverList = ::estd::forward_list<Receiver>;
331+
using ReceiverList = ::etl::intrusive_forward_list<Receiver, ::etl::forward_link<0>>;
332332
333333
vector<Point> points;
334334
int values[];

doc/codingGuidelines/conventions/statements.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ memory got corrupted (out of bounds access through operator[]). Comment the usag
184184
justification.
185185

186186
It might be acceptable during development to use asserts. In this case use ``estd_expect`` instead.
187-
``estd_expect`` behaves the same as ``estd_assert``, but it must be replaced before SOP with
187+
``estd_expect`` behaves the same as ``estd_assert``, but it must be replaced for production with
188188
proper error handling. The usage of ``estd_expect`` is detected by our code analyzers and
189189
presented in the module overview from Cijack.
190190

@@ -211,12 +211,12 @@ which improves readability. Additionally, ``using`` can be used for template ali
211211

212212
.. code-block:: cpp
213213
214-
using MyArray = ::estd::array<::some::other::Type, 199>; // good - new name comes first
214+
using MyArray = ::etl::array<::some::other::Type, 199>; // good - new name comes first
215215
216-
typedef ::estd::array<::some::other::Type, 199> MyArray; // bad - new name at the end
216+
typedef ::etl::array<::some::other::Type, 199> MyArray; // bad - new name at the end
217217
218218
template <typename T>
219-
using ArrayOf5 = ::estd::array<T, 5>; // template alias - impossible with typedef
219+
using ArrayOf5 = ::etl::array<T, 5>; // template alias - impossible with typedef
220220
221221
OS Specific Code
222222
----------------

executables/referenceApp/application/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ target_link_libraries(
4444
asyncConsole
4545
bspMcu
4646
configuration
47-
estd
47+
etl
4848
lifecycle
4949
consoleCommands
5050
logger

executables/referenceApp/application/include/systems/DoCanSystem.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <docan/datalink/DoCanFrameCodec.h>
1414
#include <docan/transmitter/IDoCanTickGenerator.h>
1515
#include <docan/transport/DoCanTransportLayerContainer.h>
16+
#include <etl/vector.h>
1617
#include <lifecycle/AsyncLifecycleComponent.h>
1718

1819
namespace can
@@ -100,7 +101,7 @@ class DoCanSystem final
100101
::docan::DoCanParameters _parameters;
101102
::docan::declare::DoCanTransportLayerConfig<DataLinkLayerType, 80U, 15U, 64U>
102103
_transportLayerConfig;
103-
::estd::declare::vector<DoCanPhysicalCanTransceiver<AddressingType>, NUM_CAN_TRANSPORT_LAYERS>
104+
::etl::vector<DoCanPhysicalCanTransceiver<AddressingType>, NUM_CAN_TRANSPORT_LAYERS>
104105
_physicalTransceivers;
105106
TransportLayers _transportLayers;
106107
TickGeneratorRunnableAdapter _tickGenerator;

0 commit comments

Comments
 (0)