tunnel component & update vehicle abstraction example (#8)

This commit is contained in:
tompzf
2026-04-02 17:37:00 +02:00
committed by GitHub
parent 6ed5fdb951
commit 07cf4f654b
94 changed files with 9268 additions and 830 deletions

View File

@@ -314,10 +314,10 @@ std::string CVSSBSCodingRX::Code_BS_RXConstructor(const SSignalVDDefinition& sig
mapKeywords["signal_name"] = function.signalName;
return ReplaceKeywords(R"code(
auto %signal_name%Device = sdv::core::GetObject("%vd_vss_original%_Device").GetInterface<vss::%vd_vssWithColons%Device::IVSS_%vd_function_name%>();
auto %signal_name%Device = sdv::core::GetObject("%vd_vss_original%_Device").GetInterface<vss::%vd_vssWithColons%Device::IVSS_Read%vd_function_name%>();
if (!%signal_name%Device)
{
SDV_LOG_ERROR("Could not get interface 'IVSS_%vd_function_name%': [CBasicService%vd_class_name%]");
SDV_LOG_ERROR("Could not get interface 'IVSS_Read%vd_function_name%': [CBasicService%vd_class_name%]");
throw std::runtime_error("%vd_vss_original% mode device not found");
}
%signal_name%Device->Register%vd_function_name%Event(dynamic_cast<vss::%vd_vssWithColons%Device::IVSS_Write%vd_function_name%_Event*> (this));
@@ -337,7 +337,7 @@ std::string CVSSBSCodingRX::Code_BS_RXDestructor(const SSignalVDDefinition& sign
mapKeywords["vd_function_name"] = functionVD.functionName;
return ReplaceKeywords(R"code(
auto %vd_signal_name%Device = sdv::core::GetObject("%vd_vss_original%_Device").GetInterface<vss::%vd_vssWithColons%Device::IVSS_%vd_function_name%>();
auto %vd_signal_name%Device = sdv::core::GetObject("%vd_vss_original%_Device").GetInterface<vss::%vd_vssWithColons%Device::IVSS_Read%vd_function_name%>();
if (%vd_signal_name%Device)
{
%vd_signal_name%Device->Unregister%vd_function_name%Event(dynamic_cast<vss::%vd_vssWithColons%Device::IVSS_Write%vd_function_name%_Event*> (this));

View File

@@ -30,7 +30,7 @@ const char szRXVehicleDeviceHeaderTemplate[] = R"code(/**
#include "../signal_identifier.h"
/**
* @brief Vehicle device %vss_original%
* @brief Platform abstraction %vss_original%
*/
class CVehicleDevice%class_name%
: public sdv::CSdvObject
@@ -128,7 +128,7 @@ public:
BEGIN_SDV_INTERFACE_MAP()
%rx_bs_interface_entry_list% END_SDV_INTERFACE_MAP()
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::device)
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::sensor)
DECLARE_OBJECT_CLASS_NAME("%vss_original%_Service")
/**

View File

@@ -30,7 +30,7 @@ const char szTXVehicleDeviceHeaderTemplate[] = R"code(/**
/**
* @brief Vehicle device %vss_shorten_no_dot%
* @brief Platform abstraction %vss_shorten_no_dot%
*/
class CVehicleDevice%class_name%
: public sdv::CSdvObject
@@ -124,7 +124,7 @@ public:
BEGIN_SDV_INTERFACE_MAP()
%tx_bs_interface_entry_list% END_SDV_INTERFACE_MAP()
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::device)
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::actuator)
DECLARE_OBJECT_CLASS_NAME("%vss_original%_Service")
/**

View File

@@ -193,9 +193,9 @@ std::string CVSSVDCodingRX::Code_RXIDLDeviceInterface(const std::string& spaces,
%multiple_spaces%};
%multiple_spaces%/**
%multiple_spaces%* @brief IVSS_%function_name% abstract %prefix% interface
%multiple_spaces%* @brief IVSS_Read%function_name% abstract %prefix% interface
%multiple_spaces%*/
%multiple_spaces%interface IVSS_%function_name%
%multiple_spaces%interface IVSS_Read%function_name%
%multiple_spaces%{
%multiple_spaces% /**
%multiple_spaces% * @brief Register Write%function_name% event on signal change
@@ -276,7 +276,7 @@ std::string CVSSVDCodingRX::Code_VD_RXInterface(const std::string & functionName
mapKeywords["function_name"] = functionName;
mapKeywords["vss_shorten_with_colons"] = vssShortenWithColons;
return ReplaceKeywords(R"code( , public vss::%vss_shorten_with_colons%Device::IVSS_%function_name%
return ReplaceKeywords(R"code( , public vss::%vss_shorten_with_colons%Device::IVSS_Read%function_name%
)code", mapKeywords);
}
@@ -286,7 +286,7 @@ std::string CVSSVDCodingRX::Code_VD_RXInterfaceEntry(const std::string& function
mapKeywords["function_name"] = functionName;
mapKeywords["vssWithColons"] = vssWithColons;
return ReplaceKeywords(R"code( SDV_INTERFACE_ENTRY(vss::%vssWithColons%Device::IVSS_%function_name%)
return ReplaceKeywords(R"code( SDV_INTERFACE_ENTRY(vss::%vssWithColons%Device::IVSS_Read%function_name%)
)code", mapKeywords);
}
@@ -305,7 +305,7 @@ std::string CVSSVDCodingRX::Code_VD_RXReAndUnregisterEvent( const std::string& v
void Register%function_name%Event(vss::%vssWithColons%Device::IVSS_Write%function_name%_Event* event) override;
/**
* @brief Unregister IVSS_%function_name%_Event
* @brief Unregister IVSS_Read%function_name%_Event
* @param[in] event function
*/
void Unregister%function_name%Event(vss::%vssWithColons%Device::IVSS_Write%function_name%_Event* event) override;
@@ -339,7 +339,7 @@ std::string CVSSVDCodingRX::Code_VD_RXPrivateHeaderPart(const SFunctionVDDefinit
*/
void ExecuteAllCallBacksFor%start_with_uppercase%(sdv::any_t value);
sdv::core::CSignal m_%signal_name%Signal; ///< Signal of the vehicle device
sdv::core::CSignal m_%signal_name%Signal; ///< Signal of the platform abstraction
mutable std::mutex m_%signal_name%MutexCallbacks; ///< Mutex protecting m_%signal_name%Callbacks
std::set<vss::%vssWithColons%Device::IVSS_Write%function_name%_Event*> m_%signal_name%Callbacks; ///< collection of events to be called
)code", mapKeywords);