Skip to content

Commit fe3fbe2

Browse files
committed
format: clang-format all files
Signed-off-by: Jan Kraemer <[email protected]>
1 parent 3bdd204 commit fe3fbe2

File tree

197 files changed

+964
-1099
lines changed

Some content is hidden

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

197 files changed

+964
-1099
lines changed

.devcontainer/devcontainer.json~

Lines changed: 0 additions & 16 deletions
This file was deleted.

Demos/api/Orchestration/Autonomous.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@ int main(int argc, char** argv)
2828
auto participant = SilKit::CreateParticipant(participantConfiguration, participantName, registryUri);
2929
auto logger = participant->GetLogger();
3030

31-
// Create an autonomous lifecycle
31+
// Create an autonomous lifecycle
3232
auto* lifecycleService =
3333
participant->CreateLifecycleService({SilKit::Services::Orchestration::OperationMode::Autonomous});
3434

3535

36-
// Future / promise to control entrance of the main loop in the worker thread
36+
// Future / promise to control entrance of the main loop in the worker thread
3737
std::promise<void> startWorkPromise;
3838
auto startWorkFuture = startWorkPromise.get_future();
3939

4040
// The worker thread is 'unleashed' in the starting handler...
41-
lifecycleService->SetStartingHandler([&startWorkPromise]() {
42-
startWorkPromise.set_value();
43-
});
41+
lifecycleService->SetStartingHandler([&startWorkPromise]() { startWorkPromise.set_value(); });
4442

4543
// Start the worker thread and wait for the go from the starting handler.
4644
auto workerThread = std::thread([&startWorkFuture, lifecycleService, logger]() {
@@ -49,7 +47,7 @@ int main(int argc, char** argv)
4947
for (int i = 0; i < 10; ++i)
5048
{
5149
std::this_thread::sleep_for(1s);
52-
logger->Info("Simulation stop in " + std::to_string(10-i));
50+
logger->Info("Simulation stop in " + std::to_string(10 - i));
5351
};
5452

5553
logger->Info("Stopping just me.");
@@ -66,7 +64,6 @@ int main(int argc, char** argv)
6664
{
6765
workerThread.join();
6866
}
69-
7067
}
7168
catch (const std::exception& error)
7269
{

Demos/api/Orchestration/Coordinated.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int main(int argc, char** argv)
3232
auto* lifecycleService =
3333
participant->CreateLifecycleService({SilKit::Services::Orchestration::OperationMode::Coordinated});
3434

35-
// Future / promise to control entrance of the main loop in the worker thread
35+
// Future / promise to control entrance of the main loop in the worker thread
3636
std::promise<void> startWorkPromise;
3737
std::future<void> startWorkFuture;
3838
startWorkFuture = startWorkPromise.get_future();

Demos/api/Orchestration/SimStep.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ int main(int argc, char** argv)
4242
timeSyncService->SetSimulationStepHandler(
4343
[logger](std::chrono::nanoseconds now, std::chrono::nanoseconds /*duration*/) {
4444
// The invocation of this handler marks the beginning of a simulation step.
45-
45+
4646
std::stringstream ss;
4747
ss << "--------- Simulation step T=" << now << " ---------";
4848
logger->Info(ss.str());
49-
49+
5050
// All messages sent here are guaranteed to arrive at other participants before their next simulation step is called.
5151
// So here, we can rely on having received all messages from the past (< now).
5252
// Note that this guarantee only holds for messages sent within a simulation step,

Demos/api/SimpleCan/SimpleCan.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ int main(int argc, char** argv)
3333
// CAN controller
3434
auto* canController = participant->CreateCanController("CanController1", "CAN1");
3535

36-
canController->AddFrameTransmitHandler([logger](ICanController* /*ctrl*/, const CanFrameTransmitEvent& /*ack*/) {
36+
canController->AddFrameTransmitHandler(
37+
[logger](ICanController* /*ctrl*/, const CanFrameTransmitEvent& /*ack*/) {
3738
logger->Info("Receive CAN frame transmit acknowledge");
3839
});
3940
canController->AddFrameHandler([logger](ICanController* /*ctrl*/, const CanFrameEvent& canFrameEvent) {
@@ -50,7 +51,8 @@ int main(int argc, char** argv)
5051
// Simulation steps
5152
const auto stepSize = 1ms;
5253
timeSyncService->SetSimulationStepHandler(
53-
[participantName, canController, logger](std::chrono::nanoseconds now, std::chrono::nanoseconds /*duration*/) {
54+
[participantName, canController, logger](std::chrono::nanoseconds now,
55+
std::chrono::nanoseconds /*duration*/) {
5456
// Send CAN Frame every 10 seconds
5557
if (now.count() % std::chrono::nanoseconds(10s).count() == 0)
5658
{
@@ -68,7 +70,8 @@ int main(int argc, char** argv)
6870
logger->Info("Sending CAN frame: data='" + payloadStr + "'");
6971
canController->SendFrame(canFrame);
7072
}
71-
}, stepSize);
73+
},
74+
stepSize);
7275

7376
// Start and wait
7477
auto finalStateFuture = lifecycleService->StartLifecycle();

Demos/communication/Can/CanDemoCommon.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ namespace CanDemoCommon {
1414
void FrameTransmitHandler(const CanFrameTransmitEvent& canFrameAck, ILogger* logger)
1515
{
1616
std::stringstream ss;
17-
ss << "Receive CAN frame transmit acknowledge: canId=" << canFrameAck.canId << ", status='" << canFrameAck.status << "'";
17+
ss << "Receive CAN frame transmit acknowledge: canId=" << canFrameAck.canId << ", status='" << canFrameAck.status
18+
<< "'";
1819
logger->Info(ss.str());
1920
}
2021

@@ -42,4 +43,4 @@ void FrameHandler(const CanFrameEvent& canFrameEvent, ILogger* logger, bool prin
4243
logger->Info(ss.str());
4344
}
4445

45-
} // namespace CanDemoBehavior
46+
} // namespace CanDemoCommon

Demos/communication/Can/CanReaderDemo.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "ApplicationBase.hpp"
66
#include "CanDemoCommon.hpp"
77

8-
class CanReader: public ApplicationBase
8+
class CanReader : public ApplicationBase
99
{
1010
public:
1111
// Inherit constructors
@@ -51,7 +51,7 @@ class CanReader: public ApplicationBase
5151
_canController->SetBaudRate(10'000, 1'000'000, 2'000'000);
5252
_canController->Start();
5353
}
54-
54+
5555
void DoWorkSync(std::chrono::nanoseconds /*now*/) override
5656
{
5757
// NOP
@@ -70,7 +70,6 @@ int main(int argc, char** argv)
7070
args.duration = 5ms;
7171
CanReader app{args};
7272
app.SetupCommandLineArgs(argc, argv, "SIL Kit Demo - Can: Log received frames");
73-
73+
7474
return app.Run();
7575
}
76-

Demos/communication/Can/CanWriterDemo.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CanWriter : public ApplicationBase
5858
// Build a CAN FD frame
5959
CanFrame canFrame{};
6060
canFrame.canId = 3;
61-
canFrame.flags = static_cast<CanFrameFlagMask>(CanFrameFlag::Fdf) // FD Format Indicator
61+
canFrame.flags = static_cast<CanFrameFlagMask>(CanFrameFlag::Fdf) // FD Format Indicator
6262
| static_cast<CanFrameFlagMask>(CanFrameFlag::Brs); // Bit Rate Switch (for FD Format only)
6363

6464
// Build a payload with the frame Id
@@ -95,7 +95,6 @@ class CanWriter : public ApplicationBase
9595
{
9696
SendFrame();
9797
}
98-
9998
};
10099

101100
int main(int argc, char** argv)

Demos/communication/Ethernet/EthernetDemoCommon.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ void FrameHandler(const EthernetFrameEvent& ethernetFrameEvent, ILogger* logger,
7171
logger->Info(ss.str());
7272
}
7373

74-
} // namespace EthernetDemoBehavior
74+
} // namespace EthernetDemoCommon

Demos/communication/Ethernet/EthernetReaderDemo.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "ApplicationBase.hpp"
66
#include "EthernetDemoCommon.hpp"
77

8-
class EthernetReader: public ApplicationBase
8+
class EthernetReader : public ApplicationBase
99
{
1010
public:
1111
// Inherit constructors
@@ -38,10 +38,12 @@ class EthernetReader: public ApplicationBase
3838
{
3939
_ethernetController = GetParticipant()->CreateEthernetController("EthernetController1", _networkName);
4040

41-
_ethernetController->AddFrameTransmitHandler([this](IEthernetController* /*ctrl*/, const EthernetFrameTransmitEvent& ack) {
41+
_ethernetController->AddFrameTransmitHandler(
42+
[this](IEthernetController* /*ctrl*/, const EthernetFrameTransmitEvent& ack) {
4243
EthernetDemoCommon::FrameTransmitHandler(ack, GetLogger());
4344
});
44-
_ethernetController->AddFrameHandler([this](IEthernetController* /*ctrl*/, const EthernetFrameEvent& frameEvent) {
45+
_ethernetController->AddFrameHandler(
46+
[this](IEthernetController* /*ctrl*/, const EthernetFrameEvent& frameEvent) {
4547
EthernetDemoCommon::FrameHandler(frameEvent, GetLogger(), _printHex);
4648
});
4749
}
@@ -50,7 +52,7 @@ class EthernetReader: public ApplicationBase
5052
{
5153
_ethernetController->Activate();
5254
}
53-
55+
5456
void DoWorkSync(std::chrono::nanoseconds /*now*/) override
5557
{
5658
// NOP
@@ -68,7 +70,6 @@ int main(int argc, char** argv)
6870
args.participantName = "EthernetReader";
6971
EthernetReader app{args};
7072
app.SetupCommandLineArgs(argc, argv, "SIL Kit Demo - Ethernet: Log received frames");
71-
73+
7274
return app.Run();
7375
}
74-

0 commit comments

Comments
 (0)