33 lines
1.1 KiB
C++
33 lines
1.1 KiB
C++
#pragma once
|
|
#include "ApiInteropCommon.h"
|
|
#include <functional>
|
|
|
|
namespace bts {
|
|
namespace api {
|
|
|
|
struct ApiClient;
|
|
CAPI ApiClient *api_client_create(
|
|
Quickbus *, const char *type_name, const char *service_qualifier);
|
|
CAPI void api_client_destroy(ApiClient *);
|
|
CAPI void api_post(
|
|
Quickbus &qbus, const std::function<void()> &callback, uint64_t delayms);
|
|
typedef void (*raw_response_callback)(
|
|
const char *buffer, size_t length, void *extra);
|
|
CAPI void api_client_send(
|
|
ApiClient *pclient, const char *buffer, int buffer_length,
|
|
raw_response_callback cb, void *extra);
|
|
CAPI bool api_client_is_on_qb_thread(ApiClient *);
|
|
|
|
enum EventType { TABLE_CREATED, TABLE_UPDATED, TABLE_DESTROYED };
|
|
|
|
typedef void *TableSubscription;
|
|
typedef void (*raw_subscription_callback)(
|
|
EventType event_type, const StreamUpdate *changes, int count, void *extra);
|
|
CAPI TableSubscription api_client_subscribe(
|
|
ApiClient *pclient, const char *method, const char *qualifier,
|
|
raw_subscription_callback cb, void *extra);
|
|
CAPI void api_client_unsubscribe(ApiClient *pclient, TableSubscription ptable);
|
|
|
|
} // namespace api
|
|
} // namespace bts
|