onboardapi-sys 9.10.0

Raw FFI to the Rheinmetall onboardapi C++ SDK through a generated extern "C" shim
Documentation
// @generated by onboardapi-codegen from the onboardapi .rmodel data model. Do not edit.
// SPDX-License-Identifier: EPL-2.0
#include "wire_VideoTrackerAtr.hpp"
#include "../obapi_runtime.hpp"

#include <type_traits>


namespace M_VideoTrackerAtr {
} // namespace M_VideoTrackerAtr

namespace {
    struct ServiceCallbacks final : ::M_VideoTrackerAtr::IService {
        ::obapi::Dispatcher dispatcher;
        void ConfigMinMaxObjectSize(::M_Common::PixelRectSizeType const& Min, ::M_Common::PixelRectSizeType const& Max) override {
            ::obapi::Writer w;
            ::obapi::put(w, Min);
            ::obapi::put(w, Max);
            dispatcher.dispatch(0u, w);
        }
        void ConfigEnable(bool Enable) override {
            ::obapi::Writer w;
            ::obapi::put(w, Enable);
            dispatcher.dispatch(1u, w);
        }
        void CmdTeachIn(bool Activate, bool Reset) override {
            ::obapi::Writer w;
            ::obapi::put(w, Activate);
            ::obapi::put(w, Reset);
            dispatcher.dispatch(2u, w);
        }
    };

    struct ClientCallbacks final : ::M_VideoTrackerAtr::IClient {
        ::obapi::Dispatcher dispatcher;
        void ReportAtrSettings(::M_VideoTracker::AtrSettingsType const& Settings) override {
            ::obapi::Writer w;
            ::obapi::put(w, Settings);
            dispatcher.dispatch(0u, w);
        }
        void ReportAtrStatus(::M_VideoTracker::AtrStatusType 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_VideoTrackerAtr::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                ::M_VideoTracker::AtrSettingsType Settings{};
                ::obapi::get(r, Settings);
                r.finish();
                h.endpoint->ReportAtrSettings(Settings);
                return;
            }
            case 1u: {
                ::M_VideoTracker::AtrStatusType Status{};
                ::obapi::get(r, Status);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportAtrStatus(Status, IsRemoved);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

    void client_send(::obapi::Holder<::M_VideoTrackerAtr::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                ::M_Common::PixelRectSizeType Min{};
                ::obapi::get(r, Min);
                ::M_Common::PixelRectSizeType Max{};
                ::obapi::get(r, Max);
                r.finish();
                h.endpoint->ConfigMinMaxObjectSize(Min, Max);
                return;
            }
            case 1u: {
                bool Enable{};
                ::obapi::get(r, Enable);
                r.finish();
                h.endpoint->ConfigEnable(Enable);
                return;
            }
            case 2u: {
                bool Activate{};
                ::obapi::get(r, Activate);
                bool Reset{};
                ::obapi::get(r, Reset);
                r.finish();
                h.endpoint->CmdTeachIn(Activate, Reset);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

} // namespace

extern "C" const obapi_vtable obapi_VideoTrackerAtr_service_vtable = ::obapi::Endpoint<::M_VideoTrackerAtr::Service, ServiceCallbacks, &service_send, false>::vtable("M_VideoTrackerAtr", "Service");
extern "C" const obapi_vtable obapi_VideoTrackerAtr_client_vtable = ::obapi::Endpoint<::M_VideoTrackerAtr::Client, ClientCallbacks, &client_send, true>::vtable("M_VideoTrackerAtr", "Client");