Skip to content

Commit 63061fa

Browse files
author
Andy Ford
authored
Merge pull request #14 from ECFMP/flow-measure-descriptions
Flow measure descriptions
2 parents 59625e1 + c1f7e67 commit 63061fa

40 files changed

+470
-8
lines changed

include/ECFMP/flowmeasure/AirportFilter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,10 @@ namespace ECFMP::FlowMeasure {
3030
* Returns the type of airport filter
3131
*/
3232
[[nodiscard]] virtual auto Type() const noexcept -> AirportFilterType = 0;
33+
34+
/**
35+
* Returns a string representation of the filter.
36+
*/
37+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
3338
};
3439
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/EventFilter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,10 @@ namespace ECFMP::FlowMeasure {
4343
* Returns true if the event participation is "Participating in"
4444
*/
4545
[[nodiscard]] virtual auto IsParticipating() const noexcept -> bool = 0;
46+
47+
/**
48+
* Returns a description of the filter.
49+
*/
50+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
4651
};
4752
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/FlowMeasureFilters.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,10 @@ namespace ECFMP::FlowMeasure {
7171
[[nodiscard]] virtual auto
7272
FirstRangeToDestinationFilter(const std::function<bool(const RangeToDestinationFilter&)>& callback
7373
) const noexcept -> std::shared_ptr<RangeToDestinationFilter> = 0;
74+
75+
/**
76+
* Convenience method to return string description of the filters.
77+
*/
78+
[[nodiscard]] virtual auto FilterDescriptions() const noexcept -> std::vector<std::string> = 0;
7479
};
7580
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/LevelRangeFilter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,10 @@ namespace ECFMP::FlowMeasure {
4141
* Helper method to determine, given a particular altitude (e.g. 35000), does this filter apply.
4242
*/
4343
[[nodiscard]] virtual auto ApplicableToAltitude(int level) const noexcept -> bool = 0;
44+
45+
/**
46+
* Description of the filter.
47+
*/
48+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
4449
};
4550
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/Measure.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,5 +73,10 @@ namespace ECFMP::FlowMeasure {
7373
* Throws an IllegalFlowMeasureValueException exception otherwise.
7474
*/
7575
[[nodiscard]] virtual auto SetValue() const -> const std::set<std::string>& = 0;
76+
77+
/**
78+
* Returns a string representation of the measure.
79+
*/
80+
[[nodiscard]] virtual auto MeasureDescription() const noexcept -> std::string = 0;
7681
};
7782
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/MultipleLevelFilter.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,10 @@ namespace ECFMP::FlowMeasure {
2929
* Helper method to determine, given a particular altitude (e.g. 35000), does this filter apply.
3030
*/
3131
[[nodiscard]] virtual auto ApplicableToAltitude(int level) const noexcept -> bool = 0;
32+
33+
/**
34+
* Description of the filter
35+
*/
36+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
3237
};
3338
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/RangeToDestinationFilter.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,16 @@ namespace ECFMP::FlowMeasure {
88
class RangeToDestinationFilter : public ChecksAircraftApplicability
99
{
1010
public:
11-
virtual ~RangeToDestinationFilter() = default;
11+
~RangeToDestinationFilter() override = default;
1212

1313
/**
1414
* Returns the range to destination.
1515
*/
1616
[[nodiscard]] virtual auto Range() const noexcept -> int = 0;
17+
18+
/**
19+
* Description of the filter
20+
*/
21+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
1722
};
1823
}// namespace ECFMP::FlowMeasure

include/ECFMP/flowmeasure/RouteFilter.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ namespace ECFMP::FlowMeasure {
99
{
1010
public:
1111
virtual ~RouteFilter() = default;
12+
13+
/**
14+
* Returns the set of route strings that this filter pertains to.
15+
* @return
16+
*/
1217
[[nodiscard]] virtual auto RouteStrings() const noexcept -> const std::set<std::string>& = 0;
18+
19+
/**
20+
* Description of the filter.
21+
*/
22+
[[nodiscard]] virtual auto FilterDescription() const noexcept -> std::string = 0;
1323
};
1424
}// namespace ECFMP::FlowMeasure

include/mock/AirportFilterMock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace ECFMP::Mock::FlowMeasure {
1111
MOCK_METHOD(ECFMP::FlowMeasure::AirportFilterType, Type, (), (const, noexcept, override));
1212
MOCK_METHOD(bool, ApplicableToAirport, (const std::string&), (const, noexcept, override));
1313
MOCK_METHOD(bool, ApplicableToAircraft, (const Euroscope::EuroscopeAircraft&), (const, noexcept, override));
14+
MOCK_METHOD(std::string, FilterDescription, (), (const, noexcept, override));
1415
};
1516

1617
}// namespace ECFMP::Mock::FlowMeasure

include/mock/EventFilterMock.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace ECFMP::Mock::FlowMeasure {
1212
MOCK_METHOD(ECFMP::FlowMeasure::EventParticipation, Participation, (), (const, noexcept, override));
1313
MOCK_METHOD(bool, IsParticipating, (), (const, noexcept, override));
1414
MOCK_METHOD(bool, ApplicableToAircraft, (const Euroscope::EuroscopeAircraft&), (const, noexcept, override));
15+
MOCK_METHOD(std::string, FilterDescription, (), (const, noexcept, override));
1516
};
1617

1718
}// namespace ECFMP::Mock::FlowMeasure

0 commit comments

Comments
 (0)