Skip to content

Commit e0245d5

Browse files
committed
refactor: return notified firs as references
1 parent fa6ff42 commit e0245d5

5 files changed

Lines changed: 9 additions & 10 deletions

File tree

include/ECFMP/flowmeasure/FlowMeasure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace ECFMP::FlowMeasure {
9797
* The flight information region(s) associated with the measure.
9898
*/
9999
[[nodiscard]] virtual auto NotifiedFlightInformationRegions() const noexcept
100-
-> const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>> = 0;
100+
-> const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>& = 0;
101101

102102
/**
103103
* Checks if the flow measure is applicable to the given flight information region.

include/mock/FlowMeasureMock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace ECFMP::Mock::FlowMeasure {
2121
MOCK_METHOD(ECFMP::FlowMeasure::MeasureStatus, Status, (), (const, noexcept, override));
2222
MOCK_METHOD(bool, HasStatus, (ECFMP::FlowMeasure::MeasureStatus), (const, noexcept, override));
2323
MOCK_METHOD(
24-
const std::vector<std::shared_ptr<const ECFMP::FlightInformationRegion::FlightInformationRegion>>,
24+
const std::vector<std::shared_ptr<const ECFMP::FlightInformationRegion::FlightInformationRegion>>&,
2525
NotifiedFlightInformationRegions, (), (const, noexcept, override)
2626
);
2727
MOCK_METHOD(const ECFMP::FlowMeasure::Measure&, Measure, (), (const, noexcept, override));

src/api/FlowMeasureDataParser.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ namespace ECFMP::Api {
8989
auto flowMeasure = std::make_shared<FlowMeasure::ConcreteFlowMeasure>(
9090
flowMeasureData.at("id").get<int>(), event, flowMeasureData.at("ident").get<std::string>(),
9191
flowMeasureData.at("reason").get<std::string>(), startTime, endTime, withdrawnAt, measureStatus,
92-
notifiedFirs, std::move(measure), std::move(filters)
92+
std::move(notifiedFirs), std::move(measure), std::move(filters)
9393
);
9494
flowMeasures->Add(flowMeasure);
9595
}

src/flowmeasure/ConcreteFlowMeasure.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace ECFMP::FlowMeasure {
1010
int id, std::shared_ptr<const Event::Event> event, std::string identifier, std::string reason,
1111
std::chrono::system_clock::time_point startTime, std::chrono::system_clock::time_point endTime,
1212
std::chrono::system_clock::time_point withdrawnTime, MeasureStatus status,
13-
const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>& notifiedFirs,
13+
const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>> notifiedFirs,
1414
std::unique_ptr<class Measure> measure, std::unique_ptr<FlowMeasureFilters> filters
1515
)
1616
: id(id), event(std::move(event)), identifier(std::move(identifier)),
@@ -72,8 +72,8 @@ namespace ECFMP::FlowMeasure {
7272
return checkStatus == status;
7373
}
7474

75-
const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>
76-
ConcreteFlowMeasure::NotifiedFlightInformationRegions() const noexcept
75+
auto ConcreteFlowMeasure::NotifiedFlightInformationRegions() const noexcept
76+
-> const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>&
7777
{
7878
return notifiedFirs;
7979
}

src/flowmeasure/ConcreteFlowMeasure.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ namespace ECFMP::FlowMeasure {
1414
int id, std::shared_ptr<const Event::Event> event, std::string identifier, std::string reason,
1515
std::chrono::system_clock::time_point startTime, std::chrono::system_clock::time_point endTime,
1616
std::chrono::system_clock::time_point withdrawnTime, MeasureStatus status,
17-
const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>&
18-
notifiedFirs,
17+
const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>> notifiedFirs,
1918
std::unique_ptr<class Measure> measure, std::unique_ptr<FlowMeasureFilters> filters
2019
);
2120
~ConcreteFlowMeasure() override;
@@ -30,15 +29,15 @@ namespace ECFMP::FlowMeasure {
3029
[[nodiscard]] auto Status() const noexcept -> MeasureStatus override;
3130
[[nodiscard]] auto HasStatus(MeasureStatus checkStatus) const noexcept -> bool override;
3231
[[nodiscard]] auto NotifiedFlightInformationRegions() const noexcept
33-
-> const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>> override;
32+
-> const std::vector<std::shared_ptr<const FlightInformationRegion::FlightInformationRegion>>& override;
3433
[[nodiscard]] auto Measure() const noexcept -> const class Measure& override;
3534
[[nodiscard]] auto Filters() const noexcept -> const FlowMeasureFilters& override;
3635
[[nodiscard]] auto IsApplicableToFlightInformationRegion(
3736
const FlightInformationRegion::FlightInformationRegion& flightInformationRegion
3837
) const noexcept -> bool override;
3938
[[nodiscard]] auto IsApplicableToFlightInformationRegion(const std::string& flightInformationRegion
4039
) const noexcept -> bool override;
41-
auto ApplicableToAircraft(
40+
[[nodiscard]] auto ApplicableToAircraft(
4241
const EuroScopePlugIn::CFlightPlan& flightplan, const EuroScopePlugIn::CRadarTarget& radarTarget
4342
) const -> bool override;
4443

0 commit comments

Comments
 (0)