Skip to content

Commit 28fcdc4

Browse files
Switch from ESTD to ETL
1 parent d8052f9 commit 28fcdc4

File tree

989 files changed

+171594
-51143
lines changed

Some content is hidden

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

989 files changed

+171594
-51143
lines changed

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
@@ -14,6 +14,7 @@
1414
#include <docan/datalink/DoCanFrameCodec.h>
1515
#include <docan/transmitter/IDoCanTickGenerator.h>
1616
#include <docan/transport/DoCanTransportLayerContainer.h>
17+
#include <etl/vector.h>
1718
#include <lifecycle/AsyncLifecycleComponent.h>
1819

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

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
#ifndef GUARD_FACE7DDD_046B_4B7B_B83F_6212136CBA2E
44
#define GUARD_FACE7DDD_046B_4B7B_B83F_6212136CBA2E
55

6+
#include <etl/singleton_base.h>
67
#include <lifecycle/AsyncLifecycleComponent.h>
78
#include <transport/ITransportMessageProvider.h>
89
#include <transport/ITransportSystem.h>
910
#include <transport/routing/TransportRouterSimple.h>
1011

11-
#include <estd/singleton.h>
12-
1312
namespace transport
1413
{
1514
class AbstractTransportLayer;
1615

1716
class TransportSystem
18-
: public ::estd::singleton<TransportSystem>
17+
: public ::etl::singleton_base<TransportSystem>
1918
, public ::transport::ITransportSystem
2019
, public ::lifecycle::AsyncLifecycleComponent
2120
{

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
#include <async/Async.h>
77
#include <async/IRunnable.h>
8+
#include <etl/singleton_base.h>
89
#include <lifecycle/AsyncLifecycleComponent.h>
910
#include <uds/DiagDispatcher.h>
1011
#include <uds/DummySessionPersistence.h>
@@ -23,8 +24,6 @@
2324
#include <uds/services/testerpresent/TesterPresent.h>
2425
#include <uds/services/writedata/WriteDataByIdentifier.h>
2526

26-
#include <estd/singleton.h>
27-
2827
namespace lifecycle
2928
{
3029
class LifecycleManager;
@@ -39,11 +38,9 @@ namespace uds
3938
{
4039
class UdsSystem
4140
: public lifecycle::AsyncLifecycleComponent
42-
, public ::estd::singleton<UdsSystem>
41+
, public ::etl::singleton_base<UdsSystem>
4342
, private ::async::IRunnable
4443
{
45-
using Base = ::estd::singleton<UdsSystem>;
46-
4744
public:
4845
UdsSystem(
4946
lifecycle::LifecycleManager& lManager,

executables/referenceApp/application/include/uds/ReadIdentifierPot.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,13 @@
33
#ifndef GUARD_DC726F41_1EE2_4343_818F_8A2F855AB88F
44
#define GUARD_DC726F41_1EE2_4343_818F_8A2F855AB88F
55

6-
#include "estd/array.h"
7-
#include "estd/slice.h"
8-
#include "estd/uncopyable.h"
96
#include "platform/estdint.h"
107
#include "uds/jobs/DataIdentifierJob.h"
118

129
namespace uds
1310
{
1411
class ReadIdentifierPot : public DataIdentifierJob
1512
{
16-
UNCOPYABLE(ReadIdentifierPot);
17-
1813
public:
1914
ReadIdentifierPot(DiagSessionMask const sessionMask = DiagSession::ALL_SESSIONS());
2015

executables/referenceApp/application/src/app/app.cpp

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "app/app.h"
44

55
#include "console/console.h"
6-
#include "estd/typed_mem.h"
76
#include "logger/logger.h"
87
#include "reset/softwareSystemReset.h"
98
#include "systems/DemoSystem.h"
@@ -12,6 +11,8 @@
1211
#include "systems/SysAdminSystem.h"
1312

1413
#include <app/appConfig.h>
14+
#include <etl/alignment.h>
15+
#include <etl/singleton.h>
1516

1617
#ifdef PLATFORM_SUPPORT_UDS
1718
#include "busid/BusId.h"
@@ -27,6 +28,8 @@
2728
#include <lifecycle/LifecycleLogger.h>
2829
#include <lifecycle/LifecycleManager.h>
2930

31+
#include <cstdio>
32+
3033
#ifdef PLATFORM_SUPPORT_CAN
3134
#include <systems/ICanSystem.h>
3235

@@ -70,21 +73,21 @@ LifecycleManager lifecycleManager{
7073
TASK_SYSADMIN,
7174
::lifecycle::LifecycleManager::GetTimestampType::create<&getSystemTimeUs32Bit>()};
7275

73-
::estd::typed_mem<::systems::RuntimeSystem> runtimeSystem;
74-
::estd::typed_mem<::systems::SysAdminSystem> sysAdminSystem;
75-
::estd::typed_mem<::systems::DemoSystem> demoSystem;
76-
::estd::typed_mem<::systems::SafetySystem> safetySystem;
76+
::etl::typed_storage<::systems::RuntimeSystem> runtimeSystem;
77+
::etl::typed_storage<::systems::SysAdminSystem> sysAdminSystem;
78+
::etl::typed_storage<::systems::DemoSystem> demoSystem;
79+
::etl::typed_storage<::systems::SafetySystem> safetySystem;
7780

7881
#ifdef PLATFORM_SUPPORT_UDS
79-
::estd::typed_mem<::transport::TransportSystem> transportSystem;
82+
::etl::typed_storage<::transport::TransportSystem> transportSystem;
8083
#endif
8184

8285
#ifdef PLATFORM_SUPPORT_CAN
83-
::estd::typed_mem<::docan::DoCanSystem> doCanSystem;
86+
::etl::typed_storage<::docan::DoCanSystem> doCanSystem;
8487
#endif
8588

8689
#ifdef PLATFORM_SUPPORT_UDS
87-
::estd::typed_mem<::uds::UdsSystem> udsSystem;
90+
::etl::typed_storage<::uds::UdsSystem> udsSystem;
8891
#endif
8992

9093
class LifecycleMonitor : private ::lifecycle::ILifecycleListener
@@ -136,39 +139,37 @@ void run()
136139
/* runlevel 1 */
137140
::platform::platformLifecycleAdd(lifecycleManager, 1U);
138141
lifecycleManager.addComponent(
139-
"runtime", runtimeSystem.emplace(TASK_BACKGROUND, runtimeMonitor), 1U);
142+
"runtime", runtimeSystem.create(TASK_BACKGROUND, runtimeMonitor), 1U);
140143
/* runlevel 2 */
141144
::platform::platformLifecycleAdd(lifecycleManager, 2U);
142145
/* runlevel 3 */
143146
::platform::platformLifecycleAdd(lifecycleManager, 3U);
144147
/* runlevel 4 */
145148
#ifdef PLATFORM_SUPPORT_UDS
146-
lifecycleManager.addComponent("transport", transportSystem.emplace(TASK_UDS), 4U);
149+
lifecycleManager.addComponent("transport", transportSystem.create(TASK_UDS), 4U);
147150
#endif
148151

149152
/* runlevel 5 */
150153
#ifdef PLATFORM_SUPPORT_CAN
151154
lifecycleManager.addComponent(
152-
"docan", doCanSystem.emplace(*transportSystem, ::systems::getCanSystem(), TASK_CAN), 5U);
155+
"docan", doCanSystem.create(*transportSystem, ::systems::getCanSystem(), TASK_CAN), 5U);
153156
#endif
154157

155158
/* runlevel 6 */
156159
#ifdef PLATFORM_SUPPORT_UDS
157160
lifecycleManager.addComponent(
158-
"uds",
159-
udsSystem.emplace(lifecycleManager, *transportSystem, TASK_UDS, LOGICAL_ADDRESS),
160-
6U);
161+
"uds", udsSystem.create(lifecycleManager, *transportSystem, TASK_UDS, LOGICAL_ADDRESS), 6U);
161162
#endif
162163

163164
/* runlevel 7 */
164165
lifecycleManager.addComponent(
165-
"sysadmin", sysAdminSystem.emplace(TASK_SYSADMIN, lifecycleManager), 7U);
166+
"sysadmin", sysAdminSystem.create(TASK_SYSADMIN, lifecycleManager), 7U);
166167

167168
/* runlevel 8 */
168169
::platform::platformLifecycleAdd(lifecycleManager, 8U);
169170
lifecycleManager.addComponent(
170171
"demo",
171-
demoSystem.emplace(
172+
demoSystem.create(
172173
TASK_DEMO,
173174
lifecycleManager
174175
#ifdef PLATFORM_SUPPORT_CAN
@@ -178,8 +179,7 @@ void run()
178179
),
179180
8U);
180181

181-
lifecycleManager.addComponent(
182-
"safety", safetySystem.emplace(TASK_SAFETY, lifecycleManager), 8U);
182+
lifecycleManager.addComponent("safety", safetySystem.create(TASK_SAFETY, lifecycleManager), 8U);
183183

184184
lifecycleManager.transitionToLevel(MaxNumLevels);
185185

executables/referenceApp/application/src/systems/DemoSystem.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
#include "app/DemoLogger.h"
1212

1313
#include <bsp/SystemTime.h>
14-
15-
#include <estd/big_endian.h>
14+
#include <etl/unaligned_type.h>
1615
#ifdef PLATFORM_SUPPORT_CAN
1716
#include <can/transceiver/AbstractCANTransceiver.h>
1817
#endif
@@ -118,9 +117,8 @@ void DemoSystem::cyclic()
118117
if (canTransceiver != nullptr)
119118
{
120119
// Logger::debug(DEMO, "Sending frame %d", canSentCount);
121-
uint8_t canData[4] = {0};
122-
::estd::write_be(canData, canSentCount);
123-
::can::CANFrame frame(0x558, canData, 4);
120+
etl::be_uint32_t canData{canSentCount};
121+
::can::CANFrame frame(0x558, static_cast<uint8_t*>(canData.data()), 4);
124122
canTransceiver->write(frame);
125123
++canSentCount;
126124
}

executables/referenceApp/application/src/systems/DoCanSystem.cpp

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
#include <bsp/timer/SystemTimer.h>
1010
#include <docan/common/DoCanLogger.h>
1111
#include <docan/datalink/DoCanFrameCodecConfigPresets.h>
12+
#include <etl/delegate.h>
13+
#include <etl/span.h>
1214

1315
namespace
1416
{
@@ -46,7 +48,7 @@ DoCanSystem::DoCanSystem(
4648
, _classicCodec(::docan::DoCanFrameCodecConfigPresets::PADDED_CLASSIC, _frameSizeMapper)
4749
, _classicAddressingFilter()
4850
, _parameters(
49-
::estd::function<decltype(systemUs)>::create<&systemUs>(),
51+
::etl::delegate<decltype(systemUs)>::create<&systemUs>(),
5052
ALLOCATE_TIMEOUT,
5153
RX_TIMEOUT,
5254
TX_CALLBACK_TIMEOUT,
@@ -72,25 +74,25 @@ void DoCanSystem::initLayer()
7274
auto& transceiver = *_canSystem.getCanTransceiver(::busid::CAN_0);
7375

7476
::docan::DoCanPhysicalCanTransceiver<AddressingType>& doCanTransceiver
75-
= _physicalTransceivers.emplace_back().construct(
76-
::estd::by_ref(transceiver),
77-
::estd::by_ref(_classicAddressingFilter),
78-
::estd::by_ref(_classicAddressingFilter),
79-
::estd::by_ref(_addressing));
77+
= _physicalTransceivers.emplace_back(
78+
::etl::ref(transceiver),
79+
::etl::ref(_classicAddressingFilter),
80+
::etl::ref(_classicAddressingFilter),
81+
::etl::ref(_addressing));
8082

81-
_transportLayers.createTransportLayer().construct(
83+
_transportLayers.emplace_back(
8284
::busid::CAN_0,
83-
::estd::by_ref(_context),
84-
::estd::by_ref(_classicAddressingFilter),
85-
::estd::by_ref(doCanTransceiver),
86-
::estd::by_ref(_tickGenerator),
87-
::estd::by_ref(_transportLayerConfig),
85+
::etl::ref(_context),
86+
::etl::ref(_classicAddressingFilter),
87+
::etl::ref(doCanTransceiver),
88+
::etl::ref(_tickGenerator),
89+
::etl::ref(_transportLayerConfig),
8890
::util::logger::DOCAN);
8991
}
9092

9193
void DoCanSystem::init()
9294
{
93-
_classicAddressingFilter.init(::estd::make_slice(_addresses), ::estd::make_slice(_codecs));
95+
_classicAddressingFilter.init(::etl::make_span(_addresses), ::etl::make_span(_codecs));
9496

9597
initLayer();
9698

executables/referenceApp/application/src/systems/TransportSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace transport
1010
{
1111
TransportSystem::TransportSystem(::async::ContextType transitionContext)
12-
: ::estd::singleton<TransportSystem>(*this)
12+
: ::etl::singleton_base<TransportSystem>(*this)
1313
{
1414
// Tell the lifecycle manager in which context to execute init/run/shutdown
1515
setTransitionContext(transitionContext);

executables/referenceApp/application/src/systems/UdsSystem.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
#include <uds/UdsLogger.h>
1111

12-
#include <estd/type_traits.h>
13-
1412
namespace uds
1513
{
1614
using ::util::logger::Logger;
@@ -26,7 +24,7 @@ UdsSystem::UdsSystem(
2624
::async::ContextType context,
2725
uint16_t udsAddress)
2826
: AsyncLifecycleComponent()
29-
, ::estd::singleton<UdsSystem>(*this)
27+
, ::etl::singleton_base<UdsSystem>(*this)
3028
, _udsLifecycleConnector(lManager)
3129
, _transportSystem(transportSystem)
3230
, _jobRoot()

0 commit comments

Comments
 (0)