#include "wire_SectorSelection.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::MinAzimuthRange), double>::value, "M_SectorSelection::SectorType field MinAzimuthRange differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::MaxAzimuthRange), std::vector<double>>::value, "M_SectorSelection::SectorType field MaxAzimuthRange differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::Azimuth), double>::value, "M_SectorSelection::SectorType field Azimuth differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::AzimuthSize), double>::value, "M_SectorSelection::SectorType field AzimuthSize differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::Elevation), std::vector<double>>::value, "M_SectorSelection::SectorType field Elevation differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::ElevationSize), std::vector<double>>::value, "M_SectorSelection::SectorType field ElevationSize differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorType::CoordinateFrame), std::string>::value, "M_SectorSelection::SectorType field CoordinateFrame differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorDefinitionType::Id), uint32_t>::value, "M_SectorSelection::SectorDefinitionType field Id differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorDefinitionType::Name), std::string>::value, "M_SectorSelection::SectorDefinitionType field Name differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorDefinitionType::Sector), ::M_SectorSelection::SectorType>::value, "M_SectorSelection::SectorDefinitionType field Sector differs from the data model");
static_assert(std::is_same<::M_SectorSelection::SectorDefinitionListType, std::vector<::M_SectorSelection::SectorDefinitionType>>::value, "typedef M_SectorSelection::SectorDefinitionListType differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SelectionInfoType::Id), uint32_t>::value, "M_SectorSelection::SelectionInfoType field Id differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SelectionInfoType::IsSelected), bool>::value, "M_SectorSelection::SelectionInfoType field IsSelected differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SelectionInfoType::IsSelectable), bool>::value, "M_SectorSelection::SelectionInfoType field IsSelectable differs from the data model");
static_assert(std::is_same<::M_SectorSelection::SelectionInfoListType, std::vector<::M_SectorSelection::SelectionInfoType>>::value, "typedef M_SectorSelection::SelectionInfoListType differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorSelectionSettingsType::IsCmdSelectSectorSupported), bool>::value, "M_SectorSelection::SectorSelectionSettingsType field IsCmdSelectSectorSupported differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorSelectionStatusType::SelectionList), std::vector<::M_SectorSelection::SelectionInfoType>>::value, "M_SectorSelection::SectorSelectionStatusType field SelectionList differs from the data model");
static_assert(std::is_same<decltype(::M_SectorSelection::SectorSelectionStatusType::IsMultipleSectorSelectionAllowed), bool>::value, "M_SectorSelection::SectorSelectionStatusType field IsMultipleSectorSelectionAllowed differs from the data model");
namespace M_SectorSelection {
void obapi_put(::obapi::Writer& w, SectorType const& v) {
::obapi::put(w, v.MinAzimuthRange);
::obapi::put(w, v.MaxAzimuthRange);
::obapi::put(w, v.Azimuth);
::obapi::put(w, v.AzimuthSize);
::obapi::put(w, v.Elevation);
::obapi::put(w, v.ElevationSize);
::obapi::put(w, v.CoordinateFrame);
}
void obapi_get(::obapi::Reader& r, SectorType& v) {
::obapi::get(r, v.MinAzimuthRange);
::obapi::get(r, v.MaxAzimuthRange);
::obapi::get(r, v.Azimuth);
::obapi::get(r, v.AzimuthSize);
::obapi::get(r, v.Elevation);
::obapi::get(r, v.ElevationSize);
::obapi::get(r, v.CoordinateFrame);
}
void obapi_put(::obapi::Writer& w, SectorDefinitionType const& v) {
::obapi::put(w, v.Id);
::obapi::put(w, v.Name);
::obapi::put(w, v.Sector);
}
void obapi_get(::obapi::Reader& r, SectorDefinitionType& v) {
::obapi::get(r, v.Id);
::obapi::get(r, v.Name);
::obapi::get(r, v.Sector);
}
void obapi_put(::obapi::Writer& w, SelectionInfoType const& v) {
::obapi::put(w, v.Id);
::obapi::put(w, v.IsSelected);
::obapi::put(w, v.IsSelectable);
}
void obapi_get(::obapi::Reader& r, SelectionInfoType& v) {
::obapi::get(r, v.Id);
::obapi::get(r, v.IsSelected);
::obapi::get(r, v.IsSelectable);
}
void obapi_put(::obapi::Writer& w, SectorSelectionSettingsType const& v) {
::obapi::put(w, v.IsCmdSelectSectorSupported);
}
void obapi_get(::obapi::Reader& r, SectorSelectionSettingsType& v) {
::obapi::get(r, v.IsCmdSelectSectorSupported);
}
void obapi_put(::obapi::Writer& w, SectorSelectionStatusType const& v) {
::obapi::put(w, v.SelectionList);
::obapi::put(w, v.IsMultipleSectorSelectionAllowed);
}
void obapi_get(::obapi::Reader& r, SectorSelectionStatusType& v) {
::obapi::get(r, v.SelectionList);
::obapi::get(r, v.IsMultipleSectorSelectionAllowed);
}
}
namespace {
struct ServiceCallbacks final : ::M_SectorSelection::IService {
::obapi::Dispatcher dispatcher;
void CmdSelectSector(::M_Common::ULongListType const& SectorIdList) override {
::obapi::Writer w;
::obapi::put(w, SectorIdList);
dispatcher.dispatch(0u, w);
}
};
struct ClientCallbacks final : ::M_SectorSelection::IClient {
::obapi::Dispatcher dispatcher;
void ReportSectorSelectionSettings(::M_SectorSelection::SectorSelectionSettingsType const& Settings) override {
::obapi::Writer w;
::obapi::put(w, Settings);
dispatcher.dispatch(0u, w);
}
void ReportSectorDefinitions(::M_SectorSelection::SectorDefinitionListType const& AvailableSectors) override {
::obapi::Writer w;
::obapi::put(w, AvailableSectors);
dispatcher.dispatch(1u, w);
}
void ReportSectorSelectionStatus(::M_SectorSelection::SectorSelectionStatusType const& Status, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, Status);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(2u, w);
}
};
void service_send(::obapi::Holder<::M_SectorSelection::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_SectorSelection::SectorSelectionSettingsType Settings{};
::obapi::get(r, Settings);
r.finish();
h.endpoint->ReportSectorSelectionSettings(Settings);
return;
}
case 1u: {
::M_SectorSelection::SectorDefinitionListType AvailableSectors{};
::obapi::get(r, AvailableSectors);
r.finish();
h.endpoint->ReportSectorDefinitions(AvailableSectors);
return;
}
case 2u: {
::M_SectorSelection::SectorSelectionStatusType Status{};
::obapi::get(r, Status);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportSectorSelectionStatus(Status, IsRemoved);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_SectorSelection::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_Common::ULongListType SectorIdList{};
::obapi::get(r, SectorIdList);
r.finish();
h.endpoint->CmdSelectSector(SectorIdList);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_SectorSelection_service_vtable = ::obapi::Endpoint<::M_SectorSelection::Service, ServiceCallbacks, &service_send, false>::vtable("M_SectorSelection", "Service");
extern "C" const obapi_vtable obapi_SectorSelection_client_vtable = ::obapi::Endpoint<::M_SectorSelection::Client, ClientCallbacks, &client_send, true>::vtable("M_SectorSelection", "Client");