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_VideoTrackerLot.hpp"
#include "../obapi_runtime.hpp"

#include <type_traits>


namespace M_VideoTrackerLot {
} // namespace M_VideoTrackerLot

namespace {
    struct ServiceCallbacks final : ::M_VideoTrackerLot::IService {
        ::obapi::Dispatcher dispatcher;
        void ConfigDefaultGateSizes(::M_Common::PixelRectSizeOptionalType const& InitGate, ::M_Common::PixelRectSizeOptionalType const& SearchArea) override {
            ::obapi::Writer w;
            ::obapi::put(w, InitGate);
            ::obapi::put(w, SearchArea);
            dispatcher.dispatch(0u, w);
        }
        void CmdLockOnAtPos(::M_Common::PixelRegionType const& LockOnArea, ::M_Common::PixelRectSizeOptionalType const& SearchArea, ::M_VideoTracker::LotModeOptionalType const& Mode, bool LeadOn) override {
            ::obapi::Writer w;
            ::obapi::put(w, LockOnArea);
            ::obapi::put(w, SearchArea);
            ::obapi::put(w, Mode);
            ::obapi::put(w, LeadOn);
            dispatcher.dispatch(1u, w);
        }
        void CmdLockOnTrack(::M_Common::ObjectIdOptionalType const& ObjId, bool LeadOn) override {
            ::obapi::Writer w;
            ::obapi::put(w, ObjId);
            ::obapi::put(w, LeadOn);
            dispatcher.dispatch(2u, w);
        }
        void CmdManualGateControl(::M_Common::ObjectIdOptionalType const& ObjId, int32_t StepX, int32_t StepY) override {
            ::obapi::Writer w;
            ::obapi::put(w, ObjId);
            ::obapi::put(w, StepX);
            ::obapi::put(w, StepY);
            dispatcher.dispatch(3u, w);
        }
        void CmdAutoGateControl(::M_Common::ObjectIdOptionalType const& ObjId) override {
            ::obapi::Writer w;
            ::obapi::put(w, ObjId);
            dispatcher.dispatch(4u, w);
        }
        void CmdForceCoasting(::M_Common::ObjectIdOptionalType const& ObjId, bool Enable) override {
            ::obapi::Writer w;
            ::obapi::put(w, ObjId);
            ::obapi::put(w, Enable);
            dispatcher.dispatch(5u, w);
        }
    };

    struct ClientCallbacks final : ::M_VideoTrackerLot::IClient {
        ::obapi::Dispatcher dispatcher;
        void ReportLotStatus(::M_VideoTracker::LotStatusType const& Status, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, Status);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(0u, w);
        }
    };

    void service_send(::obapi::Holder<::M_VideoTrackerLot::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                ::M_VideoTracker::LotStatusType Status{};
                ::obapi::get(r, Status);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportLotStatus(Status, IsRemoved);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

    void client_send(::obapi::Holder<::M_VideoTrackerLot::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                ::M_Common::PixelRectSizeOptionalType InitGate{};
                ::obapi::get(r, InitGate);
                ::M_Common::PixelRectSizeOptionalType SearchArea{};
                ::obapi::get(r, SearchArea);
                r.finish();
                h.endpoint->ConfigDefaultGateSizes(InitGate, SearchArea);
                return;
            }
            case 1u: {
                ::M_Common::PixelRegionType LockOnArea{};
                ::obapi::get(r, LockOnArea);
                ::M_Common::PixelRectSizeOptionalType SearchArea{};
                ::obapi::get(r, SearchArea);
                ::M_VideoTracker::LotModeOptionalType Mode{};
                ::obapi::get(r, Mode);
                bool LeadOn{};
                ::obapi::get(r, LeadOn);
                r.finish();
                h.endpoint->CmdLockOnAtPos(LockOnArea, SearchArea, Mode, LeadOn);
                return;
            }
            case 2u: {
                ::M_Common::ObjectIdOptionalType ObjId{};
                ::obapi::get(r, ObjId);
                bool LeadOn{};
                ::obapi::get(r, LeadOn);
                r.finish();
                h.endpoint->CmdLockOnTrack(ObjId, LeadOn);
                return;
            }
            case 3u: {
                ::M_Common::ObjectIdOptionalType ObjId{};
                ::obapi::get(r, ObjId);
                int32_t StepX{};
                ::obapi::get(r, StepX);
                int32_t StepY{};
                ::obapi::get(r, StepY);
                r.finish();
                h.endpoint->CmdManualGateControl(ObjId, StepX, StepY);
                return;
            }
            case 4u: {
                ::M_Common::ObjectIdOptionalType ObjId{};
                ::obapi::get(r, ObjId);
                r.finish();
                h.endpoint->CmdAutoGateControl(ObjId);
                return;
            }
            case 5u: {
                ::M_Common::ObjectIdOptionalType ObjId{};
                ::obapi::get(r, ObjId);
                bool Enable{};
                ::obapi::get(r, Enable);
                r.finish();
                h.endpoint->CmdForceCoasting(ObjId, Enable);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

} // namespace

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