#include "wire_ReplayCtrl.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
static_assert(static_cast<uint32_t>(::M_ReplayCtrl::ReplayLoopMode::No_Loop) == 0u, "enum value M_ReplayCtrl::ReplayLoopMode::Type::No_Loop differs from the data model");
static_assert(static_cast<uint32_t>(::M_ReplayCtrl::ReplayLoopMode::Infinite_Loop) == 1u, "enum value M_ReplayCtrl::ReplayLoopMode::Type::Infinite_Loop differs from the data model");
static_assert(static_cast<uint32_t>(::M_ReplayCtrl::ReplayStartMode::Play) == 0u, "enum value M_ReplayCtrl::ReplayStartMode::Type::Play differs from the data model");
static_assert(static_cast<uint32_t>(::M_ReplayCtrl::ReplayStartMode::Pause) == 1u, "enum value M_ReplayCtrl::ReplayStartMode::Type::Pause differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::SupportedReplayChannelsType::SourceVideoChannel), std::string>::value, "M_ReplayCtrl::SupportedReplayChannelsType field SourceVideoChannel differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::SupportedReplayChannelsType::ReplayChannelList), std::vector<std::string>>::value, "M_ReplayCtrl::SupportedReplayChannelsType field ReplayChannelList differs from the data model");
static_assert(std::is_same<::M_ReplayCtrl::SupportedReplayChannelsListType, std::vector<::M_ReplayCtrl::SupportedReplayChannelsType>>::value, "typedef M_ReplayCtrl::SupportedReplayChannelsListType differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplaySettingsType::IsStartStopReplaySupported), bool>::value, "M_ReplayCtrl::ReplaySettingsType field IsStartStopReplaySupported differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplaySettingsType::IsPauseResumeReplaySupported), bool>::value, "M_ReplayCtrl::ReplaySettingsType field IsPauseResumeReplaySupported differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplaySettingsType::IsStepReplaySupported), bool>::value, "M_ReplayCtrl::ReplaySettingsType field IsStepReplaySupported differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplaySettingsType::SupportedReplayChannels), std::vector<::M_ReplayCtrl::SupportedReplayChannelsType>>::value, "M_ReplayCtrl::ReplaySettingsType field SupportedReplayChannels differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayTimelineType::SourceVideoChannel), std::string>::value, "M_ReplayCtrl::ReplayTimelineType field SourceVideoChannel differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayTimelineType::IntervalList), std::vector<::M_Common::TimeIntervalType>>::value, "M_ReplayCtrl::ReplayTimelineType field IntervalList differs from the data model");
static_assert(std::is_same<::M_ReplayCtrl::ReplayTimelineListType, std::vector<::M_ReplayCtrl::ReplayTimelineType>>::value, "typedef M_ReplayCtrl::ReplayTimelineListType differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayChannelInfoType::SourceVideoChannel), std::string>::value, "M_ReplayCtrl::ReplayChannelInfoType field SourceVideoChannel differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayChannelInfoType::ReplayVideoChannel), std::string>::value, "M_ReplayCtrl::ReplayChannelInfoType field ReplayVideoChannel differs from the data model");
static_assert(std::is_same<::M_ReplayCtrl::ReplayChannelInfoListType, std::vector<::M_ReplayCtrl::ReplayChannelInfoType>>::value, "typedef M_ReplayCtrl::ReplayChannelInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayStatusType::ReplayTimelines), std::vector<::M_ReplayCtrl::ReplayTimelineType>>::value, "M_ReplayCtrl::ReplayStatusType field ReplayTimelines differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayStatusType::InProgressReplays), std::vector<::M_ReplayCtrl::ReplayChannelInfoType>>::value, "M_ReplayCtrl::ReplayStatusType field InProgressReplays differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayStatusType::RunningReplayChannels), std::vector<std::string>>::value, "M_ReplayCtrl::ReplayStatusType field RunningReplayChannels differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayStatusType::PausedReplayChannels), std::vector<std::string>>::value, "M_ReplayCtrl::ReplayStatusType field PausedReplayChannels differs from the data model");
static_assert(std::is_same<decltype(::M_ReplayCtrl::ReplayStatusType::LoopingReplayChannels), std::vector<std::string>>::value, "M_ReplayCtrl::ReplayStatusType field LoopingReplayChannels differs from the data model");
namespace M_ReplayCtrl {
void obapi_put(::obapi::Writer& w, SupportedReplayChannelsType const& v) {
::obapi::put(w, v.SourceVideoChannel);
::obapi::put(w, v.ReplayChannelList);
}
void obapi_get(::obapi::Reader& r, SupportedReplayChannelsType& v) {
::obapi::get(r, v.SourceVideoChannel);
::obapi::get(r, v.ReplayChannelList);
}
void obapi_put(::obapi::Writer& w, ReplaySettingsType const& v) {
::obapi::put(w, v.IsStartStopReplaySupported);
::obapi::put(w, v.IsPauseResumeReplaySupported);
::obapi::put(w, v.IsStepReplaySupported);
::obapi::put(w, v.SupportedReplayChannels);
}
void obapi_get(::obapi::Reader& r, ReplaySettingsType& v) {
::obapi::get(r, v.IsStartStopReplaySupported);
::obapi::get(r, v.IsPauseResumeReplaySupported);
::obapi::get(r, v.IsStepReplaySupported);
::obapi::get(r, v.SupportedReplayChannels);
}
void obapi_put(::obapi::Writer& w, ReplayTimelineType const& v) {
::obapi::put(w, v.SourceVideoChannel);
::obapi::put(w, v.IntervalList);
}
void obapi_get(::obapi::Reader& r, ReplayTimelineType& v) {
::obapi::get(r, v.SourceVideoChannel);
::obapi::get(r, v.IntervalList);
}
void obapi_put(::obapi::Writer& w, ReplayChannelInfoType const& v) {
::obapi::put(w, v.SourceVideoChannel);
::obapi::put(w, v.ReplayVideoChannel);
}
void obapi_get(::obapi::Reader& r, ReplayChannelInfoType& v) {
::obapi::get(r, v.SourceVideoChannel);
::obapi::get(r, v.ReplayVideoChannel);
}
void obapi_put(::obapi::Writer& w, ReplayStatusType const& v) {
::obapi::put(w, v.ReplayTimelines);
::obapi::put(w, v.InProgressReplays);
::obapi::put(w, v.RunningReplayChannels);
::obapi::put(w, v.PausedReplayChannels);
::obapi::put(w, v.LoopingReplayChannels);
}
void obapi_get(::obapi::Reader& r, ReplayStatusType& v) {
::obapi::get(r, v.ReplayTimelines);
::obapi::get(r, v.InProgressReplays);
::obapi::get(r, v.RunningReplayChannels);
::obapi::get(r, v.PausedReplayChannels);
::obapi::get(r, v.LoopingReplayChannels);
}
}
namespace {
struct ServiceCallbacks final : ::M_ReplayCtrl::IService {
::obapi::Dispatcher dispatcher;
void CmdStartReplay(::M_ReplayCtrl::ReplayChannelInfoListType const& ReplaysList, ::M_Common::TimeType const& StartTime, ::M_Common::TimeOptionalType const& StopTime, ::M_ReplayCtrl::ReplayLoopMode::Type LoopMode, ::M_ReplayCtrl::ReplayStartMode::Type StartMode) override {
::obapi::Writer w;
::obapi::put(w, ReplaysList);
::obapi::put(w, StartTime);
::obapi::put(w, StopTime);
::obapi::put(w, LoopMode);
::obapi::put(w, StartMode);
dispatcher.dispatch(0u, w);
}
void CmdLoopReplay(::M_Common::StringListType const& ReplayVideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, ReplayVideoChannelList);
dispatcher.dispatch(1u, w);
}
void CmdStopReplay(::M_Common::StringListType const& ReplayVideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, ReplayVideoChannelList);
dispatcher.dispatch(2u, w);
}
void CmdPauseReplay(::M_Common::StringListType const& ReplayVideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, ReplayVideoChannelList);
dispatcher.dispatch(3u, w);
}
void CmdResumeReplay(::M_Common::StringListType const& ReplayVideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, ReplayVideoChannelList);
dispatcher.dispatch(4u, w);
}
void CmdStepReplay(::M_Common::StringListType const& ReplayVideoChannelList) override {
::obapi::Writer w;
::obapi::put(w, ReplayVideoChannelList);
dispatcher.dispatch(5u, w);
}
};
struct ClientCallbacks final : ::M_ReplayCtrl::IClient {
::obapi::Dispatcher dispatcher;
void ReportReplaySettings(::M_ReplayCtrl::ReplaySettingsType const& Settings) override {
::obapi::Writer w;
::obapi::put(w, Settings);
dispatcher.dispatch(0u, w);
}
void ReportReplayStatus(::M_ReplayCtrl::ReplayStatusType 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_ReplayCtrl::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_ReplayCtrl::ReplaySettingsType Settings{};
::obapi::get(r, Settings);
r.finish();
h.endpoint->ReportReplaySettings(Settings);
return;
}
case 1u: {
::M_ReplayCtrl::ReplayStatusType Status{};
::obapi::get(r, Status);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportReplayStatus(Status, IsRemoved);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_ReplayCtrl::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_ReplayCtrl::ReplayChannelInfoListType ReplaysList{};
::obapi::get(r, ReplaysList);
::M_Common::TimeType StartTime{};
::obapi::get(r, StartTime);
::M_Common::TimeOptionalType StopTime{};
::obapi::get(r, StopTime);
::M_ReplayCtrl::ReplayLoopMode::Type LoopMode{};
::obapi::get(r, LoopMode);
::M_ReplayCtrl::ReplayStartMode::Type StartMode{};
::obapi::get(r, StartMode);
r.finish();
h.endpoint->CmdStartReplay(ReplaysList, StartTime, StopTime, LoopMode, StartMode);
return;
}
case 1u: {
::M_Common::StringListType ReplayVideoChannelList{};
::obapi::get(r, ReplayVideoChannelList);
r.finish();
h.endpoint->CmdLoopReplay(ReplayVideoChannelList);
return;
}
case 2u: {
::M_Common::StringListType ReplayVideoChannelList{};
::obapi::get(r, ReplayVideoChannelList);
r.finish();
h.endpoint->CmdStopReplay(ReplayVideoChannelList);
return;
}
case 3u: {
::M_Common::StringListType ReplayVideoChannelList{};
::obapi::get(r, ReplayVideoChannelList);
r.finish();
h.endpoint->CmdPauseReplay(ReplayVideoChannelList);
return;
}
case 4u: {
::M_Common::StringListType ReplayVideoChannelList{};
::obapi::get(r, ReplayVideoChannelList);
r.finish();
h.endpoint->CmdResumeReplay(ReplayVideoChannelList);
return;
}
case 5u: {
::M_Common::StringListType ReplayVideoChannelList{};
::obapi::get(r, ReplayVideoChannelList);
r.finish();
h.endpoint->CmdStepReplay(ReplayVideoChannelList);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_ReplayCtrl_service_vtable = ::obapi::Endpoint<::M_ReplayCtrl::Service, ServiceCallbacks, &service_send, false>::vtable("M_ReplayCtrl", "Service");
extern "C" const obapi_vtable obapi_ReplayCtrl_client_vtable = ::obapi::Endpoint<::M_ReplayCtrl::Client, ClientCallbacks, &client_send, true>::vtable("M_ReplayCtrl", "Client");