#include "wire_ActuationCtrl.hpp"
#include "../obapi_runtime.hpp"
#include <type_traits>
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Undefined) == 0u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Undefined differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Mode_Commanded) == 1u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Mode_Commanded differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Actuator) == 2u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Actuator differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Engine) == 3u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Engine differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Electric_Motor) == 4u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Electric_Motor differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Thrust_Engine) == 5u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Thrust_Engine differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Brake) == 6u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Brake differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Valve) == 7u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Valve differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Pump) == 8u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Pump differs from the data model");
static_assert(static_cast<uint32_t>(::M_ActuationCtrl::ActuationCategoryKind::Light) == 9u, "enum value M_ActuationCtrl::ActuationCategoryKind::Type::Light differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::PulseWidthType::LowInterval), double>::value, "M_ActuationCtrl::PulseWidthType field LowInterval differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::PulseWidthType::HighInterval), double>::value, "M_ActuationCtrl::PulseWidthType field HighInterval differs from the data model");
static_assert(std::is_same<::M_ActuationCtrl::PulseWidthOptionalType, std::vector<::M_ActuationCtrl::PulseWidthType>>::value, "typedef M_ActuationCtrl::PulseWidthOptionalType differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::OperationModeCommand), std::vector<::M_Common::OperationModeType>>::value, "M_ActuationCtrl::ActuationCommandType field OperationModeCommand differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::ScaledCommand), std::vector<double>>::value, "M_ActuationCtrl::ActuationCommandType field ScaledCommand differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::AngleCommand), std::vector<double>>::value, "M_ActuationCtrl::ActuationCommandType field AngleCommand differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::SpeedCommand), std::vector<double>>::value, "M_ActuationCtrl::ActuationCommandType field SpeedCommand differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::VoltageCommand), std::vector<double>>::value, "M_ActuationCtrl::ActuationCommandType field VoltageCommand differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCommandType::PulseWidth), std::vector<::M_ActuationCtrl::PulseWidthType>>::value, "M_ActuationCtrl::ActuationCommandType field PulseWidth differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::OperationStatus), std::vector<::M_Common::OperationStatusType>>::value, "M_ActuationCtrl::ActuationStateType field OperationStatus differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::Scaled), std::vector<double>>::value, "M_ActuationCtrl::ActuationStateType field Scaled differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::Angle), std::vector<double>>::value, "M_ActuationCtrl::ActuationStateType field Angle differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::Speed), std::vector<double>>::value, "M_ActuationCtrl::ActuationStateType field Speed differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::Current), std::vector<double>>::value, "M_ActuationCtrl::ActuationStateType field Current differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStateType::PulseWidth), std::vector<::M_ActuationCtrl::PulseWidthType>>::value, "M_ActuationCtrl::ActuationStateType field PulseWidth differs from the data model");
static_assert(std::is_same<::M_ActuationCtrl::ActuationStateOptionalType, std::vector<::M_ActuationCtrl::ActuationStateType>>::value, "typedef M_ActuationCtrl::ActuationStateOptionalType differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStatusType::CurrentState), ::M_ActuationCtrl::ActuationStateType>::value, "M_ActuationCtrl::ActuationStatusType field CurrentState differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationStatusType::ReferenceState), std::vector<::M_ActuationCtrl::ActuationStateType>>::value, "M_ActuationCtrl::ActuationStatusType field ReferenceState differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationComponentType::Id), std::string>::value, "M_ActuationCtrl::ActuationComponentType field Id differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationComponentType::ActuationCategory), ::M_ActuationCtrl::ActuationCategoryKind::Type>::value, "M_ActuationCtrl::ActuationComponentType field ActuationCategory differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationComponentType::MinimumLimit), std::vector<::M_ActuationCtrl::ActuationStateType>>::value, "M_ActuationCtrl::ActuationComponentType field MinimumLimit differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationComponentType::MaximumLimit), std::vector<::M_ActuationCtrl::ActuationStateType>>::value, "M_ActuationCtrl::ActuationComponentType field MaximumLimit differs from the data model");
static_assert(std::is_same<::M_ActuationCtrl::ActuationComponentListType, std::vector<::M_ActuationCtrl::ActuationComponentType>>::value, "typedef M_ActuationCtrl::ActuationComponentListType differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCtrlSettingsType::ActuationComponentList), std::vector<::M_ActuationCtrl::ActuationComponentType>>::value, "M_ActuationCtrl::ActuationCtrlSettingsType field ActuationComponentList differs from the data model");
static_assert(std::is_same<decltype(::M_ActuationCtrl::ActuationCtrlSettingsType::AdditionalInfo), std::vector<::M_Common::PropertyType>>::value, "M_ActuationCtrl::ActuationCtrlSettingsType field AdditionalInfo differs from the data model");
namespace M_ActuationCtrl {
void obapi_put(::obapi::Writer& w, PulseWidthType const& v) {
::obapi::put(w, v.LowInterval);
::obapi::put(w, v.HighInterval);
}
void obapi_get(::obapi::Reader& r, PulseWidthType& v) {
::obapi::get(r, v.LowInterval);
::obapi::get(r, v.HighInterval);
}
void obapi_put(::obapi::Writer& w, ActuationCommandType const& v) {
::obapi::put(w, v.OperationModeCommand);
::obapi::put(w, v.ScaledCommand);
::obapi::put(w, v.AngleCommand);
::obapi::put(w, v.SpeedCommand);
::obapi::put(w, v.VoltageCommand);
::obapi::put(w, v.PulseWidth);
}
void obapi_get(::obapi::Reader& r, ActuationCommandType& v) {
::obapi::get(r, v.OperationModeCommand);
::obapi::get(r, v.ScaledCommand);
::obapi::get(r, v.AngleCommand);
::obapi::get(r, v.SpeedCommand);
::obapi::get(r, v.VoltageCommand);
::obapi::get(r, v.PulseWidth);
}
void obapi_put(::obapi::Writer& w, ActuationStateType const& v) {
::obapi::put(w, v.OperationStatus);
::obapi::put(w, v.Scaled);
::obapi::put(w, v.Angle);
::obapi::put(w, v.Speed);
::obapi::put(w, v.Current);
::obapi::put(w, v.PulseWidth);
}
void obapi_get(::obapi::Reader& r, ActuationStateType& v) {
::obapi::get(r, v.OperationStatus);
::obapi::get(r, v.Scaled);
::obapi::get(r, v.Angle);
::obapi::get(r, v.Speed);
::obapi::get(r, v.Current);
::obapi::get(r, v.PulseWidth);
}
void obapi_put(::obapi::Writer& w, ActuationStatusType const& v) {
::obapi::put(w, v.CurrentState);
::obapi::put(w, v.ReferenceState);
}
void obapi_get(::obapi::Reader& r, ActuationStatusType& v) {
::obapi::get(r, v.CurrentState);
::obapi::get(r, v.ReferenceState);
}
void obapi_put(::obapi::Writer& w, ActuationComponentType const& v) {
::obapi::put(w, v.Id);
::obapi::put(w, v.ActuationCategory);
::obapi::put(w, v.MinimumLimit);
::obapi::put(w, v.MaximumLimit);
}
void obapi_get(::obapi::Reader& r, ActuationComponentType& v) {
::obapi::get(r, v.Id);
::obapi::get(r, v.ActuationCategory);
::obapi::get(r, v.MinimumLimit);
::obapi::get(r, v.MaximumLimit);
}
void obapi_put(::obapi::Writer& w, ActuationCtrlSettingsType const& v) {
::obapi::put(w, v.ActuationComponentList);
::obapi::put(w, v.AdditionalInfo);
}
void obapi_get(::obapi::Reader& r, ActuationCtrlSettingsType& v) {
::obapi::get(r, v.ActuationComponentList);
::obapi::get(r, v.AdditionalInfo);
}
}
namespace {
struct ServiceCallbacks final : ::M_ActuationCtrl::IService {
::obapi::Dispatcher dispatcher;
void CmdIsActuationAlive() override {
::obapi::Writer w;
dispatcher.dispatch(0u, w);
}
void ConfigActuationComponentReference(std::string const& KeyId, ::M_ActuationCtrl::ActuationCommandType const& ReferenceState, bool StorePersistently, bool IsRemoved) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, ReferenceState);
::obapi::put(w, StorePersistently);
::obapi::put(w, IsRemoved);
dispatcher.dispatch(1u, w);
}
void NotifyActuationComponentCommand(std::string const& KeyId, ::M_ActuationCtrl::ActuationCommandType const& Command) override {
::obapi::Writer w;
::obapi::put(w, KeyId);
::obapi::put(w, Command);
dispatcher.dispatch(2u, w);
}
};
struct ClientCallbacks final : ::M_ActuationCtrl::IClient {
::obapi::Dispatcher dispatcher;
void ReportActuationCtrlSettings(::M_ActuationCtrl::ActuationCtrlSettingsType const& Settings) override {
::obapi::Writer w;
::obapi::put(w, Settings);
dispatcher.dispatch(0u, w);
}
void ReportActuationComponentStatus(std::string const& KeyId, ::M_ActuationCtrl::ActuationStatusType 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_ActuationCtrl::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
::M_ActuationCtrl::ActuationCtrlSettingsType Settings{};
::obapi::get(r, Settings);
r.finish();
h.endpoint->ReportActuationCtrlSettings(Settings);
return;
}
case 1u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_ActuationCtrl::ActuationStatusType Status{};
::obapi::get(r, Status);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ReportActuationComponentStatus(KeyId, Status, IsRemoved);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
void client_send(::obapi::Holder<::M_ActuationCtrl::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
switch (op) {
case 0u: {
r.finish();
h.endpoint->CmdIsActuationAlive();
return;
}
case 1u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_ActuationCtrl::ActuationCommandType ReferenceState{};
::obapi::get(r, ReferenceState);
bool StorePersistently{};
::obapi::get(r, StorePersistently);
bool IsRemoved{};
::obapi::get(r, IsRemoved);
r.finish();
h.endpoint->ConfigActuationComponentReference(KeyId, ReferenceState, StorePersistently, IsRemoved);
return;
}
case 2u: {
std::string KeyId{};
::obapi::get(r, KeyId);
::M_ActuationCtrl::ActuationCommandType Command{};
::obapi::get(r, Command);
r.finish();
h.endpoint->NotifyActuationComponentCommand(KeyId, Command);
return;
}
default: throw ::obapi::UnknownOp(op);
}
}
}
extern "C" const obapi_vtable obapi_ActuationCtrl_service_vtable = ::obapi::Endpoint<::M_ActuationCtrl::Service, ServiceCallbacks, &service_send, false>::vtable("M_ActuationCtrl", "Service");
extern "C" const obapi_vtable obapi_ActuationCtrl_client_vtable = ::obapi::Endpoint<::M_ActuationCtrl::Client, ClientCallbacks, &client_send, true>::vtable("M_ActuationCtrl", "Client");