#include "wire_CameraManager.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
namespace M_CameraManager {
}
namespace {
struct ServiceCallbacks final : ::M_CameraManager::IService {
::obapi::Dispatcher dispatcher;
void CmdCreateCamera(std::string const& KeyId, ::M_Camera::CameraSettingsType const& CameraSettings) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, CameraSettings);
dispatcher.dispatch(0u, w);
}
void CmdUpdateCamera(std::string const& KeyId, ::M_Camera::CameraSettingsType const& CameraSettings) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, CameraSettings);
dispatcher.dispatch(1u, w);
}
void CmdDeleteCamera(std::string const& KeyId) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
dispatcher.dispatch(2u, w);
}
};
struct ClientCallbacks final : ::M_CameraManager::IClient {
::obapi::Dispatcher dispatcher;
void ReportCameraSettings(std::string const& KeyId, ::M_Camera::CameraSettingsType const& Settings, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, Settings);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(0u, w);
}
void ReportCameraStatus(std::string const& KeyId, ::M_Camera::CameraStatusType const& Status, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, Status);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(1u, w);
}
};
void service_send(::obapi::Holder<::M_CameraManager::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_Camera::CameraSettingsType Settings{};
::obapi::get(r, Settings);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportCameraSettings(KeyId, Settings, IsRemoved);
return;
}
case 1u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_Camera::CameraStatusType Status{};
::obapi::get(r, Status);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportCameraStatus(KeyId, Status, IsRemoved);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_CameraManager::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_Camera::CameraSettingsType CameraSettings{};
::obapi::get(r, CameraSettings);
r.finish();
h.endpoint->CmdCreateCamera(KeyId, CameraSettings);
return;
}
case 1u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_Camera::CameraSettingsType CameraSettings{};
::obapi::get(r, CameraSettings);
r.finish();
h.endpoint->CmdUpdateCamera(KeyId, CameraSettings);
return;
}
case 2u: {
std::string KeyId{};
::obapi::get(r, KeyId);
r.finish();
h.endpoint->CmdDeleteCamera(KeyId);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_CameraManager_service_vtable = ::obapi::Endpoint<::M_CameraManager::Service, ServiceCallbacks, &service_send, false>::vtable("M_CameraManager", "Service");
extern "C" const obapi_vtable obapi_CameraManager_client_vtable = ::obapi::Endpoint<::M_CameraManager::Client, ClientCallbacks, &client_send, true>::vtable("M_CameraManager", "Client");