Update sdv_packager (#6)

This commit is contained in:
tompzf
2026-03-27 14:12:49 +01:00
committed by GitHub
parent 234be8917f
commit aefefd52f7
717 changed files with 42252 additions and 11334 deletions

View File

@@ -1,3 +1,16 @@
/********************************************************************************
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
*
* This program and the accompanying materials are made available under the
* terms of the Apache License Version 2.0 which is available at
* https://www.apache.org/licenses/LICENSE-2.0
*
* SPDX-License-Identifier: Apache-2.0
*
* Contributors:
* Thomas Pfleiderer - initial API and implementation
********************************************************************************/
/**
* @brief file template for the RX signals (device header)
*/
@@ -21,15 +34,13 @@ const char szRXVehicleDeviceHeaderTemplate[] = R"code(/**
*/
class CVehicleDevice%class_name%
: public sdv::CSdvObject
, public sdv::IObjectControl
%rx_vd_interface_list%{
public:
BEGIN_SDV_INTERFACE_MAP()
SDV_INTERFACE_ENTRY(sdv::IObjectControl)
%rx_vd_interface_entry_list% END_SDV_INTERFACE_MAP()
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::Device)
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::vehicle_bus)
DECLARE_OBJECT_CLASS_NAME("%vss_original%_Device")
/**
@@ -37,32 +48,19 @@ public:
*/
CVehicleDevice%class_name%();
/**
* @brief initialize device to get the object name or use the default.
* @param[in] objectConfig Configuration containing the object name
*/
void Initialize(const sdv::u8string& objectConfig) override;
/**
* @brief Initialization event, called after object configuration was loaded. Overload of sdv::CSdvObject::OnInitialize.
* @return Returns 'true' when the initialization was successful, 'false' when not.
*/
virtual bool OnInitialize() override;
/**
* @brief Gets the current status of the object
* @return EObjectStatus The current status of the object
*/
sdv::EObjectStatus GetStatus() const override;
/**
* @brief Set the component operation mode. Overlovd of sdv::IObjectControl::SetOperationMode.
* @param[in] eMode The operation mode, the component should run in.
*/
void SetOperationMode(/*in*/ sdv::EOperationMode eMode) override;
/**
* @brief Shutdown function is to shutdown the execution of request thread
*/
void Shutdown() override;
/**
* @brief Shutdown the object. Overload of sdv::CSdvObject::OnShutdown.
*/
virtual void OnShutdown() override;
%rx_vd_register_events_list%
private:
%rx_vd_private_vd_header_part%
std::atomic<sdv::EObjectStatus> m_status = { sdv::EObjectStatus::initialization_pending }; ///< To update the object status when it changes.
};
DEFINE_SDV_OBJECT(CVehicleDevice%class_name%)
@@ -88,58 +86,17 @@ CVehicleDevice%class_name%::CVehicleDevice%class_name%()
{
}
/**
* @brief initialize device to get the object name or use the default.
* @param[in] objectConfig Configuration containing the object name
*/
void CVehicleDevice%class_name%::Initialize(const sdv::u8string&)
bool CVehicleDevice%class_name%::OnInitialize()
{
if (m_status != sdv::EObjectStatus::initialization_pending)
{
return;
}
sdv::core::CDispatchService dispatch;
%rx_vd_subscribe_signals%
%rx_check_subscriptions%
return true;
}
/**
* @brief Gets the current status of the object
* @return EObjectStatus The current status of the object
*/
sdv::EObjectStatus CVehicleDevice%class_name%::GetStatus() const
{
return m_status;
}
/**
* @brief Set the component operation mode. Overlovd of sdv::IObjectControl::SetOperationMode.
* @param[in] eMode The operation mode, the component should run in.
*/
void CVehicleDevice%class_name%::SetOperationMode(/*in*/ sdv::EOperationMode eMode)
{
switch (eMode)
{
case sdv::EOperationMode::configuring:
if (m_status == sdv::EObjectStatus::running || m_status == sdv::EObjectStatus::initialized)
m_status = sdv::EObjectStatus::configuring;
break;
case sdv::EOperationMode::running:
if (m_status == sdv::EObjectStatus::configuring || m_status == sdv::EObjectStatus::initialized)
m_status = sdv::EObjectStatus::running;
break;
default:
break;
}
}
/**
* @brief Shutdown function is to shutdown the execution of request thread
*/
void CVehicleDevice%class_name%::Shutdown()
void CVehicleDevice%class_name%::OnShutdown()
{
%rx_reset_signals%
m_status = sdv::EObjectStatus::destruction_pending;
}
%rx_vd_register%
)code";
@@ -171,7 +128,7 @@ public:
BEGIN_SDV_INTERFACE_MAP()
%rx_bs_interface_entry_list% END_SDV_INTERFACE_MAP()
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::BasicService)
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::device)
DECLARE_OBJECT_CLASS_NAME("%vss_original%_Service")
/**