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

#include <type_traits>


namespace M_VideoTrackerCommon {
} // namespace M_VideoTrackerCommon

namespace {
    struct ServiceCallbacks final : ::M_VideoTrackerCommon::IService {
        ::obapi::Dispatcher dispatcher;
        void CmdIsSensorAlive() override {
            ::obapi::Writer w;
            dispatcher.dispatch(0u, w);
        }
        void CmdDeleteTracks(::M_Common::ObjectIdListType const& KeyIdList) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyIdList);
            dispatcher.dispatch(1u, w);
        }
        void CmdDeleteAllTracks() override {
            ::obapi::Writer w;
            dispatcher.dispatch(2u, w);
        }
        void CmdDeactivateSensor(bool Deactivate) override {
            ::obapi::Writer w;
            ::obapi::put(w, Deactivate);
            dispatcher.dispatch(3u, w);
        }
        void ConfigSensorCoverage(::M_Common::ObjectIdType const& KeyId, ::M_Sensor::SensorCoverageType const& Coverage, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyId);
            ::obapi::put(w, Coverage);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(4u, w);
        }
        void CmdSetPreset(::M_Common::ObjectIdOptionalType const& Preset) override {
            ::obapi::Writer w;
            ::obapi::put(w, Preset);
            dispatcher.dispatch(5u, w);
        }
        void CmdLockOnTracks(::M_Common::ObjectIdListType const& KeyIdList) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyIdList);
            dispatcher.dispatch(6u, w);
        }
        void CmdLoadParameterSet(::M_Common::BoundedStringType const& ParameterSetName) override {
            ::obapi::Writer w;
            ::obapi::put(w, ParameterSetName);
            dispatcher.dispatch(7u, w);
        }
        void CmdSelectObject(::M_Common::HorizontalDirectionOptionalType const& Horizontal, ::M_Common::VerticalDirectionOptionalType const& Vertical, ::M_Common::SphericalPositionOptionalType const& Position) override {
            ::obapi::Writer w;
            ::obapi::put(w, Horizontal);
            ::obapi::put(w, Vertical);
            ::obapi::put(w, Position);
            dispatcher.dispatch(8u, w);
        }
        void ConfigVtTrackInfo(::M_Common::ObjectIdType const& KeyId, ::M_Sensor::SensorDetectionType const& Detection, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyId);
            ::obapi::put(w, Detection);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(9u, w);
        }
    };

    struct ClientCallbacks final : ::M_VideoTrackerCommon::IClient {
        ::obapi::Dispatcher dispatcher;
        void ReportSensorSettings(::M_Sensor::SensorSettingsType const& Settings) override {
            ::obapi::Writer w;
            ::obapi::put(w, Settings);
            dispatcher.dispatch(0u, w);
        }
        void ReportSensorStatus(::M_Sensor::SensorStatusType const& Status, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, Status);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(1u, w);
        }
        void ReportSensorCoverage(::M_Common::ObjectIdType const& KeyId, ::M_Sensor::SensorCoverageType const& Coverage, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyId);
            ::obapi::put(w, Coverage);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(2u, w);
        }
        void EventSensorDetection(::M_Common::ObjectIdType const& DetectionId, ::M_Sensor::SensorDetectionType const& Detection) override {
            ::obapi::Writer w;
            ::obapi::put(w, DetectionId);
            ::obapi::put(w, Detection);
            dispatcher.dispatch(3u, w);
        }
        void ReportSensorTrack(::M_Common::ObjectIdType const& KeyId, ::M_Sensor::SensorDetectionType const& Track, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyId);
            ::obapi::put(w, Track);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(4u, w);
        }
        void ReportVtProcessingStat(uint32_t KeyProcChainId, ::M_VideoTracker::VtProcessingStatType const& Statistics, bool IsRemoved) override {
            ::obapi::Writer w;
            ::obapi::put(w, KeyProcChainId);
            ::obapi::put(w, Statistics);
            ::obapi::put(w, IsRemoved);
            dispatcher.dispatch(5u, w);
        }
    };

    void service_send(::obapi::Holder<::M_VideoTrackerCommon::Service, ServiceCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                ::M_Sensor::SensorSettingsType Settings{};
                ::obapi::get(r, Settings);
                r.finish();
                h.endpoint->ReportSensorSettings(Settings);
                return;
            }
            case 1u: {
                ::M_Sensor::SensorStatusType Status{};
                ::obapi::get(r, Status);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportSensorStatus(Status, IsRemoved);
                return;
            }
            case 2u: {
                ::M_Common::ObjectIdType KeyId{};
                ::obapi::get(r, KeyId);
                ::M_Sensor::SensorCoverageType Coverage{};
                ::obapi::get(r, Coverage);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportSensorCoverage(KeyId, Coverage, IsRemoved);
                return;
            }
            case 3u: {
                ::M_Common::ObjectIdType DetectionId{};
                ::obapi::get(r, DetectionId);
                ::M_Sensor::SensorDetectionType Detection{};
                ::obapi::get(r, Detection);
                r.finish();
                h.endpoint->EventSensorDetection(DetectionId, Detection);
                return;
            }
            case 4u: {
                ::M_Common::ObjectIdType KeyId{};
                ::obapi::get(r, KeyId);
                ::M_Sensor::SensorDetectionType Track{};
                ::obapi::get(r, Track);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportSensorTrack(KeyId, Track, IsRemoved);
                return;
            }
            case 5u: {
                uint32_t KeyProcChainId{};
                ::obapi::get(r, KeyProcChainId);
                ::M_VideoTracker::VtProcessingStatType Statistics{};
                ::obapi::get(r, Statistics);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ReportVtProcessingStat(KeyProcChainId, Statistics, IsRemoved);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

    void client_send(::obapi::Holder<::M_VideoTrackerCommon::Client, ClientCallbacks>& h, uint32_t op, ::obapi::Reader& r) {
        switch (op) {
            case 0u: {
                r.finish();
                h.endpoint->CmdIsSensorAlive();
                return;
            }
            case 1u: {
                ::M_Common::ObjectIdListType KeyIdList{};
                ::obapi::get(r, KeyIdList);
                r.finish();
                h.endpoint->CmdDeleteTracks(KeyIdList);
                return;
            }
            case 2u: {
                r.finish();
                h.endpoint->CmdDeleteAllTracks();
                return;
            }
            case 3u: {
                bool Deactivate{};
                ::obapi::get(r, Deactivate);
                r.finish();
                h.endpoint->CmdDeactivateSensor(Deactivate);
                return;
            }
            case 4u: {
                ::M_Common::ObjectIdType KeyId{};
                ::obapi::get(r, KeyId);
                ::M_Sensor::SensorCoverageType Coverage{};
                ::obapi::get(r, Coverage);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ConfigSensorCoverage(KeyId, Coverage, IsRemoved);
                return;
            }
            case 5u: {
                ::M_Common::ObjectIdOptionalType Preset{};
                ::obapi::get(r, Preset);
                r.finish();
                h.endpoint->CmdSetPreset(Preset);
                return;
            }
            case 6u: {
                ::M_Common::ObjectIdListType KeyIdList{};
                ::obapi::get(r, KeyIdList);
                r.finish();
                h.endpoint->CmdLockOnTracks(KeyIdList);
                return;
            }
            case 7u: {
                ::M_Common::BoundedStringType ParameterSetName{};
                ::obapi::get(r, ParameterSetName);
                r.finish();
                h.endpoint->CmdLoadParameterSet(ParameterSetName);
                return;
            }
            case 8u: {
                ::M_Common::HorizontalDirectionOptionalType Horizontal{};
                ::obapi::get(r, Horizontal);
                ::M_Common::VerticalDirectionOptionalType Vertical{};
                ::obapi::get(r, Vertical);
                ::M_Common::SphericalPositionOptionalType Position{};
                ::obapi::get(r, Position);
                r.finish();
                h.endpoint->CmdSelectObject(Horizontal, Vertical, Position);
                return;
            }
            case 9u: {
                ::M_Common::ObjectIdType KeyId{};
                ::obapi::get(r, KeyId);
                ::M_Sensor::SensorDetectionType Detection{};
                ::obapi::get(r, Detection);
                bool IsRemoved{};
                ::obapi::get(r, IsRemoved);
                r.finish();
                h.endpoint->ConfigVtTrackInfo(KeyId, Detection, IsRemoved);
                return;
            }
            default: throw ::obapi::UnknownOp(op);
        }
    }

} // namespace

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