diff options
Diffstat (limited to 'src/pke-at-data-interface.hpp')
| -rw-r--r-- | src/pke-at-data-interface.hpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/pke-at-data-interface.hpp b/src/pke-at-data-interface.hpp new file mode 100644 index 0000000..ec10747 --- /dev/null +++ b/src/pke-at-data-interface.hpp @@ -0,0 +1,38 @@ +#ifndef PKE_AT_PKE_AT_DATA_INTERFACE_HPP +#define PKE_AT_PKE_AT_DATA_INTERFACE_HPP + +#include "pke-at-data-interface-types.hpp" + +enum pke_at_data_interface_result_code { + pke_at_data_interface_result_code_none = 0, + pke_at_data_interface_result_code_success = 1, + pke_at_data_interface_result_code_error = 2, +}; + +struct pke_at_data_interface_response { + pke_at_data_interface_result_code result_code; +}; + +template <typename T> +struct pke_at_data_interface_response_t { + pke_at_data_interface_result_code result_code; + T *value; +}; + +#define FPADIR std::future<pke_at_data_interface_response> +#define FPADIRT(T) std::future<pke_at_data_interface_response_t<T>> +#define PPADIR std::promise<pke_at_data_interface_response> +#define PPADIRT(T) std::promise<pke_at_data_interface_response_t<T>> + +struct pke_at_data_interface { + pke_at_data_interface() = default; + virtual ~pke_at_data_interface() = default; + virtual void init() const = 0; + virtual void teardown() const = 0; + virtual FPADIRT(pk_arr_t<di_service_type>) get_service_types() const = 0; + virtual FPADIRT(pk_arr_t<di_plan>) get_plans_upcoming_from_service_type() const = 0; + virtual FPADIRT(pk_arr_t<di_plan_item>) get_plan_items() const = 0; + // virtual FPADIRT(pk_arr_t<pke_at_plan_details>) get_song_arrangements() const = 0; +}; + +#endif /* PKE_AT_PKE_AT_DATA_INTERFACE_HPP */ |
