summaryrefslogtreecommitdiff
path: root/src/pke-at-data-interface.hpp
blob: ec1074721ef01c4603d20ee4fade86039c4f5111 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 */