Skip to content

Commit 0d47de2

Browse files
committed
refactor: rename ConcreteSDK
1 parent 9c478a8 commit 0d47de2

7 files changed

Lines changed: 25 additions & 25 deletions

File tree

src/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ set(src_pch
3030
pch.h pch.cpp)
3131

3232
set(src_plugin
33-
plugin/ConcreteSdk.h
34-
plugin/ConcreteSdk.cpp
33+
plugin/InternalSdk.h
34+
plugin/InternalSdk.cpp
3535
plugin/SdkFactory.cpp ../include/ECFMP/SdkEvents.h plugin/InternalSdkEvents.h)
3636

3737
set(src_time time/Clock.cpp time/Clock.h)
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#include "ConcreteSdk.h"
1+
#include "InternalSdk.h"
22
#include "InternalSdkEvents.h"
33
#include "eventbus/InternalEventBus.h"
44

55
namespace ECFMP::Plugin {
6-
ConcreteSdk::ConcreteSdk(std::shared_ptr<EventBus::InternalEventBus> eventBus)
6+
InternalSdk::InternalSdk(std::shared_ptr<EventBus::InternalEventBus> eventBus)
77
: eventBus(std::move(eventBus)),
88
flightInformationRegions(std::make_shared<Api::InternalFlightInformationRegionCollection>()),
99
events(std::make_shared<Api::InternalEventCollection>()),
@@ -12,53 +12,53 @@ namespace ECFMP::Plugin {
1212
assert(this->eventBus && "Event bus not set in ConcreteSdk");
1313
}
1414

15-
void ConcreteSdk::Destroy()
15+
void InternalSdk::Destroy()
1616
{
1717
eventBus.reset();
1818
}
1919

20-
auto ConcreteSdk::EventBus() const noexcept -> EventBus::EventBus&
20+
auto InternalSdk::EventBus() const noexcept -> EventBus::EventBus&
2121
{
2222
return *eventBus;
2323
}
2424

25-
void ConcreteSdk::OnEuroscopeTimerTick()
25+
void InternalSdk::OnEuroscopeTimerTick()
2626
{
2727
eventBus->OnEvent<EuroscopeTimerTickEvent>(EuroscopeTimerTickEvent{});
2828
}
2929

30-
auto ConcreteSdk::FlightInformationRegions() const noexcept
30+
auto InternalSdk::FlightInformationRegions() const noexcept
3131
-> std::shared_ptr<const Api::FlightInformationRegionCollection>
3232
{
3333
auto lock = std::lock_guard(mutex);
3434
return flightInformationRegions;
3535
}
3636

37-
void ConcreteSdk::OnEvent(const FlightInformationRegionsUpdatedEvent& event)
37+
void InternalSdk::OnEvent(const FlightInformationRegionsUpdatedEvent& event)
3838
{
3939
auto lock = std::lock_guard(mutex);
4040
flightInformationRegions = event.firs;
4141
}
4242

43-
auto ConcreteSdk::Events() const noexcept -> std::shared_ptr<const Api::EventCollection>
43+
auto InternalSdk::Events() const noexcept -> std::shared_ptr<const Api::EventCollection>
4444
{
4545
auto lock = std::lock_guard(mutex);
4646
return events;
4747
}
4848

49-
void ConcreteSdk::OnEvent(const EventsUpdatedEvent& event)
49+
void InternalSdk::OnEvent(const EventsUpdatedEvent& event)
5050
{
5151
auto lock = std::lock_guard(mutex);
5252
events = event.events;
5353
}
5454

55-
auto ConcreteSdk::FlowMeasures() const noexcept -> std::shared_ptr<const Api::FlowMeasureCollection>
55+
auto InternalSdk::FlowMeasures() const noexcept -> std::shared_ptr<const Api::FlowMeasureCollection>
5656
{
5757
auto lock = std::lock_guard(mutex);
5858
return flowMeasures;
5959
}
6060

61-
void ConcreteSdk::OnEvent(const FlowMeasuresUpdatedEvent& eventType)
61+
void InternalSdk::OnEvent(const FlowMeasuresUpdatedEvent& eventType)
6262
{
6363
auto lock = std::lock_guard(mutex);
6464
flowMeasures = eventType.flowMeasures;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ namespace ECFMP {
1717

1818
namespace ECFMP::Plugin {
1919

20-
class ConcreteSdk : public Sdk,
20+
class InternalSdk : public Sdk,
2121
public EventBus::EventListener<Plugin::FlightInformationRegionsUpdatedEvent>,
2222
public EventBus::EventListener<Plugin::EventsUpdatedEvent>,
2323
public EventBus::EventListener<Plugin::FlowMeasuresUpdatedEvent>
2424
{
2525
public:
26-
ConcreteSdk(std::shared_ptr<EventBus::InternalEventBus> eventBus);
27-
~ConcreteSdk() override = default;
26+
InternalSdk(std::shared_ptr<EventBus::InternalEventBus> eventBus);
27+
~InternalSdk() override = default;
2828

2929
[[nodiscard]] auto FlightInformationRegions() const noexcept
3030
-> std::shared_ptr<const Api::FlightInformationRegionCollection> override;

src/plugin/SdkFactory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#include "ECFMP/SdkFactory.h"
2-
#include "ConcreteSdk.h"
32
#include "ECFMP/SdkEvents.h"
43
#include "ECFMP/flightinformationregion/FlightInformationRegion.h"
54
#include "ECFMP/http/HttpClient.h"
65
#include "ECFMP/log/Logger.h"
6+
#include "InternalSdk.h"
77
#include "InternalSdkEvents.h"
88
#include "api/ApiDataDownloadedEvent.h"
99
#include "api/ApiDataDownloader.h"
@@ -136,7 +136,7 @@ namespace ECFMP::Plugin {
136136
impl->RegisterEventListeners();
137137

138138
// Set up the SDK
139-
auto sdk = std::make_shared<ConcreteSdk>(impl->GetEventBus());
139+
auto sdk = std::make_shared<InternalSdk>(impl->GetEventBus());
140140
impl->GetEventBus()->SubscribeAsync<Plugin::FlightInformationRegionsUpdatedEvent>(sdk);
141141
impl->GetEventBus()->SubscribeAsync<Plugin::EventsUpdatedEvent>(sdk);
142142
impl->GetEventBus()->SubscribeAsync<Plugin::FlowMeasuresUpdatedEvent>(sdk);

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ set(test__pch
6060

6161
set(test__plugin
6262
plugin/SdkFactoryTest.cpp
63-
plugin/ConcreteSdkTest.cpp)
63+
plugin/InternalSdkTest.cpp)
6464

6565
set(test__other
6666
main.cpp
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#include "plugin/ConcreteSdk.h"
21
#include "ECFMP/eventbus/EventListener.h"
32
#include "eventbus/InternalEventBusFactory.h"
43
#include "mock/MockHttpClient.h"
4+
#include "plugin/InternalSdk.h"
55

66
namespace ECFMPTest::Plugin {
77

@@ -24,7 +24,7 @@ namespace ECFMPTest::Plugin {
2424
{}
2525

2626
std::shared_ptr<ECFMP::EventBus::InternalEventBus> eventBus;
27-
ECFMP::Plugin::ConcreteSdk instance;
27+
ECFMP::Plugin::InternalSdk instance;
2828
};
2929

3030
TEST_F(ConcreteSdkTest, OnEuroscopeTimerTickTriggersEvent)

test/plugin/SdkFactoryTest.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "flowmeasure/FlowMeasureStatusUpdates.h"
1212
#include "mock/MockHttpClient.h"
1313
#include "mock/MockLogger.h"
14-
#include "plugin/ConcreteSdk.h"
14+
#include "plugin/InternalSdk.h"
1515
#include "plugin/InternalSdkEvents.h"
1616

1717
namespace ECFMPTest::Plugin {
@@ -102,7 +102,7 @@ namespace ECFMPTest::Plugin {
102102
auto hasListener =
103103
InternalBus(instance)
104104
.HasListenerForSubscription<
105-
ECFMP::Plugin::ConcreteSdk, ECFMP::Plugin::FlightInformationRegionsUpdatedEvent>(
105+
ECFMP::Plugin::InternalSdk, ECFMP::Plugin::FlightInformationRegionsUpdatedEvent>(
106106
{ECFMP::EventBus::EventDispatchMode::Async, false}
107107
);
108108
EXPECT_TRUE(hasListener);
@@ -114,7 +114,7 @@ namespace ECFMPTest::Plugin {
114114
const auto instance = ECFMP::Plugin::SdkFactory::Build().WithHttpClient(std::move(http)).Instance();
115115
auto hasListener =
116116
InternalBus(instance)
117-
.HasListenerForSubscription<ECFMP::Plugin::ConcreteSdk, ECFMP::Plugin::EventsUpdatedEvent>(
117+
.HasListenerForSubscription<ECFMP::Plugin::InternalSdk, ECFMP::Plugin::EventsUpdatedEvent>(
118118
{ECFMP::EventBus::EventDispatchMode::Async, false}
119119
);
120120
EXPECT_TRUE(hasListener);
@@ -126,7 +126,7 @@ namespace ECFMPTest::Plugin {
126126
const auto instance = ECFMP::Plugin::SdkFactory::Build().WithHttpClient(std::move(http)).Instance();
127127
auto hasListener = InternalBus(instance)
128128
.HasListenerForSubscription<
129-
ECFMP::Plugin::ConcreteSdk, ECFMP::Plugin::FlowMeasuresUpdatedEvent>(
129+
ECFMP::Plugin::InternalSdk, ECFMP::Plugin::FlowMeasuresUpdatedEvent>(
130130
{ECFMP::EventBus::EventDispatchMode::Async, false}
131131
);
132132
EXPECT_TRUE(hasListener);

0 commit comments

Comments
 (0)