| 1055 | ~Server() override = default; |
| 1056 | |
| 1057 | arrow::Status |
| 1058 | ListFlights(const arrow::flight::ServerCallContext &context, |
| 1059 | const arrow::flight::Criteria *criteria, |
| 1060 | std::unique_ptr<arrow::flight::FlightListing> *listing) override |
| 1061 | { |
| 1062 | auto gacontext = gaflight_server_call_context_new_raw(&context); |
| 1063 | GAFlightCriteria *gacriteria = nullptr; |
| 1064 | if (criteria) { |
| 1065 | gacriteria = gaflight_criteria_new_raw(criteria); |
| 1066 | } |
| 1067 | GError *gerror = nullptr; |
| 1068 | auto gaflights = |
| 1069 | gaflight_server_list_flights(gaserver_, gacontext, gacriteria, &gerror); |
| 1070 | if (gacriteria) { |
| 1071 | g_object_unref(gacriteria); |
| 1072 | } |
| 1073 | g_object_unref(gacontext); |
| 1074 | if (gerror) { |
| 1075 | return garrow_error_to_status(gerror, |
| 1076 | arrow::StatusCode::UnknownError, |
| 1077 | "[flight-server][list-flights]"); |
| 1078 | } |
| 1079 | std::vector<arrow::flight::FlightInfo> flights; |
| 1080 | for (auto node = gaflights; node; node = node->next) { |
| 1081 | auto gaflight = GAFLIGHT_INFO(node->data); |
| 1082 | flights.push_back(*gaflight_info_get_raw(gaflight)); |
| 1083 | g_object_unref(gaflight); |
| 1084 | } |
| 1085 | g_list_free(gaflights); |
| 1086 | *listing = std::make_unique<arrow::flight::SimpleFlightListing>(flights); |
| 1087 | return arrow::Status::OK(); |
| 1088 | } |
| 1089 | |
| 1090 | arrow::Status |
| 1091 | GetFlightInfo(const arrow::flight::ServerCallContext &context, |
no test coverage detected