#ifndef AIRMAP_AIRSPACES_H_ #define AIRMAP_AIRSPACES_H_ #include #include #include #include #include #include #include namespace airmap { /// Airspaces provides functionality to query the airspace database. class Airspaces : DoNotCopyOrMove { public: /// ForIds groups together types to ease interaction with /// Airspaces::ForIds. struct ForIds { /// Parameters bundles up input parameters. struct Parameters { Airspace::Id id; ///< Search for the airspace with this id. }; /// Result models the outcome of calling Airspaces::for_id. using Result = Outcome; /// Callback describes the function signature of the callback that is /// invoked when a call to Airspaces::for_id finishes. using Callback = std::function; }; /// Search groups together types to ease interaction with /// Airspaces::Search. struct Search { /// Parameters bundles up input parameters. struct Parameters { Optional types; ///< Search for airspaces with either one of these types. Optional ignored_types; ///< Ignore airspaces with either one of these types. Optional full; ///< If true, the complete description of airspaces in the result set is requested. Geometry geometry; ///< Search airspaces intersection this geometry. Optional buffer; ///< Buffer around the geometry in [m]. Optional limit; ///< Limit the number of results to 'limit'. Optional offset; Optional date_time; }; /// Result models the outcome of calling Airspaces::search. using Result = Outcome, Error>; /// Callback describes the function signature of the callback that is /// invoked when a call to Airspaces::search finishes. using Callback = std::function; }; /// search queries the AirMap services for surrounding airspaces and /// reports back the results to 'cb'. virtual void search(const Search::Parameters& parameters, const Search::Callback& cb) = 0; /// for_ids queries the AirMap services for detailed information about /// airspaces identified by UUIDs and reports back results to 'cb'. virtual void for_ids(const ForIds::Parameters& parameters, const ForIds::Callback& cb) = 0; protected: /// cond Airspaces() = default; /// @endcond }; } // namespace airmap #endif // AIRMAP_AIRSPACES_H_