#include "wire_RecordingCtrl.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoChannelType::Id), std::string>::value, "M_RecordingCtrl::VideoChannelType field Id differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoChannelType::Name), std::string>::value, "M_RecordingCtrl::VideoChannelType field Name differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoChannelType::EncryptionInfo), std::vector<::M_Common::EncryptionType>>::value, "M_RecordingCtrl::VideoChannelType field EncryptionInfo differs from the data model");
static_assert(std::is_same<::M_RecordingCtrl::VideoChannelListType, std::vector<::M_RecordingCtrl::VideoChannelType>>::value, "typedef M_RecordingCtrl::VideoChannelListType differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingSettingsType::IsStartStopRecordingSupported), bool>::value, "M_RecordingCtrl::RecordingSettingsType field IsStartStopRecordingSupported differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingSettingsType::IsCaptureVideoCutoutSupported), bool>::value, "M_RecordingCtrl::RecordingSettingsType field IsCaptureVideoCutoutSupported differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingSettingsType::SupportedRecordingChannels), std::vector<::M_RecordingCtrl::VideoChannelType>>::value, "M_RecordingCtrl::RecordingSettingsType field SupportedRecordingChannels differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingSettingsType::IsCaptureImageSupported), bool>::value, "M_RecordingCtrl::RecordingSettingsType field IsCaptureImageSupported differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingSettingsType::SupportedImageCaptureChannels), std::vector<::M_RecordingCtrl::VideoChannelType>>::value, "M_RecordingCtrl::RecordingSettingsType field SupportedImageCaptureChannels differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoCutoutInfoType::VideoChannelId), std::string>::value, "M_RecordingCtrl::VideoCutoutInfoType field VideoChannelId differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoCutoutInfoType::StartTime), ::M_Common::TimeType>::value, "M_RecordingCtrl::VideoCutoutInfoType field StartTime differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoCutoutInfoType::StopTime), ::M_Common::TimeType>::value, "M_RecordingCtrl::VideoCutoutInfoType field StopTime differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::VideoCutoutInfoType::Description), std::string>::value, "M_RecordingCtrl::VideoCutoutInfoType field Description differs from the data model");
static_assert(std::is_same<::M_RecordingCtrl::VideoCutoutInfoListType, std::vector<::M_RecordingCtrl::VideoCutoutInfoType>>::value, "typedef M_RecordingCtrl::VideoCutoutInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingStatusType::VideoCutoutList), std::vector<::M_RecordingCtrl::VideoCutoutInfoType>>::value, "M_RecordingCtrl::RecordingStatusType field VideoCutoutList differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingStatusType::InProgressRecordingsList), std::vector<std::string>>::value, "M_RecordingCtrl::RecordingStatusType field InProgressRecordingsList differs from the data model");
static_assert(std::is_same<decltype(::M_RecordingCtrl::RecordingStatusType::NumberOfCapturedImages), std::vector<uint32_t>>::value, "M_RecordingCtrl::RecordingStatusType field NumberOfCapturedImages differs from the data model");
namespace M_RecordingCtrl {
void obapi_put(::obapi::Writer& w, VideoChannelType const& v) {
::obapi::put(w, v.Id);
::obapi::put(w, v.Name);
::obapi::put(w, v.EncryptionInfo);
}
void obapi_get(::obapi::Reader& r, VideoChannelType& v) {
::obapi::get(r, v.Id);
::obapi::get(r, v.Name);
::obapi::get(r, v.EncryptionInfo);
}
void obapi_put(::obapi::Writer& w, RecordingSettingsType const& v) {
::obapi::put(w, v.IsStartStopRecordingSupported);
::obapi::put(w, v.IsCaptureVideoCutoutSupported);
::obapi::put(w, v.SupportedRecordingChannels);
::obapi::put(w, v.IsCaptureImageSupported);
::obapi::put(w, v.SupportedImageCaptureChannels);
}
void obapi_get(::obapi::Reader& r, RecordingSettingsType& v) {
::obapi::get(r, v.IsStartStopRecordingSupported);
::obapi::get(r, v.IsCaptureVideoCutoutSupported);
::obapi::get(r, v.SupportedRecordingChannels);
::obapi::get(r, v.IsCaptureImageSupported);
::obapi::get(r, v.SupportedImageCaptureChannels);
}
void obapi_put(::obapi::Writer& w, VideoCutoutInfoType const& v) {
::obapi::put(w, v.VideoChannelId);
::obapi::put(w, v.StartTime);
::obapi::put(w, v.StopTime);
::obapi::put(w, v.Description);
}
void obapi_get(::obapi::Reader& r, VideoCutoutInfoType& v) {
::obapi::get(r, v.VideoChannelId);
::obapi::get(r, v.StartTime);
::obapi::get(r, v.StopTime);
::obapi::get(r, v.Description);
}
void obapi_put(::obapi::Writer& w, RecordingStatusType const& v) {
::obapi::put(w, v.VideoCutoutList);
::obapi::put(w, v.InProgressRecordingsList);
::obapi::put(w, v.NumberOfCapturedImages);
}
void obapi_get(::obapi::Reader& r, RecordingStatusType& v) {
::obapi::get(r, v.VideoCutoutList);
::obapi::get(r, v.InProgressRecordingsList);
::obapi::get(r, v.NumberOfCapturedImages);
}
}
namespace {
struct ServiceCallbacks final : ::M_RecordingCtrl::IService {
::obapi::Dispatcher dispatcher;
void CmdStartRecording(::M_RecordingCtrl::VideoChannelListType const& VideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, VideoChannelList);
dispatcher.dispatch(0u, w);
}
void CmdCaptureVideoCutout(::M_Common::StringListType const& VideoChannelIdList, ::M_Common::TimeType const& StartTime, ::M_Common::TimeType const& StopTime, std::string const& Description) override {
::obapi::Writer w;
::obapi::put(w, VideoChannelIdList);
::obapi::put(w, StartTime);
::obapi::put(w, StopTime);
::obapi::put(w, Description);
dispatcher.dispatch(1u, w);
}
void CmdStopRecording(::M_Common::StringListType const& VideoChannelIdList) override {
::obapi::Writer w;
::obapi::put(w, VideoChannelIdList);
dispatcher.dispatch(2u, w);
}
void CmdRemoveVideoCutout(std::string const& VideoChannelId, ::M_Common::TimeType const& StartTime, ::M_Common::TimeType const& StopTime) override {
::obapi::Writer w;
::obapi::put(w, VideoChannelId);
::obapi::put(w, StartTime);
::obapi::put(w, StopTime);
dispatcher.dispatch(3u, w);
}
void CmdRemoveAllVideoCutouts() override {
::obapi::Writer w;
dispatcher.dispatch(4u, w);
}
void CmdCaptureImage(::M_Common::StringListType const& VideoChannelIdList) override {
::obapi::Writer w;
::obapi::put(w, VideoChannelIdList);
dispatcher.dispatch(5u, w);
}
};
struct ClientCallbacks final : ::M_RecordingCtrl::IClient {
::obapi::Dispatcher dispatcher;
void ReportRecordingSettings(::M_RecordingCtrl::RecordingSettingsType const& Settings) override {
::obapi::Writer w;
::obapi::put(w, Settings);
dispatcher.dispatch(0u, w);
}
void ReportRecordingStatus(::M_RecordingCtrl::RecordingStatusType const& Status, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, Status);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(1u, w);
}
};
void service_send(::obapi::Holder<::M_RecordingCtrl::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_RecordingCtrl::RecordingSettingsType Settings{};
::obapi::get(r, Settings);
r.finish();
h.endpoint->ReportRecordingSettings(Settings);
return;
}
case 1u: {
::M_RecordingCtrl::RecordingStatusType Status{};
::obapi::get(r, Status);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportRecordingStatus(Status, IsRemoved);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_RecordingCtrl::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_RecordingCtrl::VideoChannelListType VideoChannelList{};
::obapi::get(r, VideoChannelList);
r.finish();
h.endpoint->CmdStartRecording(VideoChannelList);
return;
}
case 1u: {
::M_Common::StringListType VideoChannelIdList{};
::obapi::get(r, VideoChannelIdList);
::M_Common::TimeType StartTime{};
::obapi::get(r, StartTime);
::M_Common::TimeType StopTime{};
::obapi::get(r, StopTime);
std::string Description{};
::obapi::get(r, Description);
r.finish();
h.endpoint->CmdCaptureVideoCutout(VideoChannelIdList, StartTime, StopTime, Description);
return;
}
case 2u: {
::M_Common::StringListType VideoChannelIdList{};
::obapi::get(r, VideoChannelIdList);
r.finish();
h.endpoint->CmdStopRecording(VideoChannelIdList);
return;
}
case 3u: {
std::string VideoChannelId{};
::obapi::get(r, VideoChannelId);
::M_Common::TimeType StartTime{};
::obapi::get(r, StartTime);
::M_Common::TimeType StopTime{};
::obapi::get(r, StopTime);
r.finish();
h.endpoint->CmdRemoveVideoCutout(VideoChannelId, StartTime, StopTime);
return;
}
case 4u: {
r.finish();
h.endpoint->CmdRemoveAllVideoCutouts();
return;
}
case 5u: {
::M_Common::StringListType VideoChannelIdList{};
::obapi::get(r, VideoChannelIdList);
r.finish();
h.endpoint->CmdCaptureImage(VideoChannelIdList);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_RecordingCtrl_service_vtable = ::obapi::Endpoint<::M_RecordingCtrl::Service, ServiceCallbacks, &service_send, false>::vtable("M_RecordingCtrl", "Service");
extern "C" const obapi_vtable obapi_RecordingCtrl_client_vtable = ::obapi::Endpoint<::M_RecordingCtrl::Client, ClientCallbacks, &client_send, true>::vtable("M_RecordingCtrl", "Client");