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:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Include cross-compilation toolchain file
include(../cross-compile-tools.cmake)

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef EXECUTABLES_ERROR_MSG
#define EXECUTABLES_ERROR_MSG
@@ -87,17 +100,25 @@ MAKE_ERROR_MSG(-1013, CMDLN_SOURCE_FILE_MISSING, "No source file specified.", "T
MAKE_ERROR_MSG(-1014, CMDLN_TOO_MANY_SOURCE_FILES, "Too many source files were specified.", "Too many source files were specified at the command line. Only one file is supported at the time.")
MAKE_ERROR_MSG(-1015, CMDLN_INCOMPATIBLE_ARGUMENTS, "Incompatible arguments were supplied, not fitting the command.", "Some arguments cannot be combined with the command on the command line.")
MAKE_ERROR_MSG(-1016, CMDLN_MISSING_SHOW_COMMAND, "Missing show command.", "The command SHOW was supplied on the command line, but not what to show.")
MAKE_ERROR_MSG(-1017, CMDLN_INVALID_CONFIG_STRING, "The configuration string is invalid.", "The configuration string should consist of path (only for local) followed by +component,component,....")
MAKE_ERROR_MSG(-1018, SAVE_INSTALL_MANIFEST_ERROR, "Failed to save the installation manifest.", "Saving the installation manifest returned with an error.")
MAKE_ERROR_MSG(-1019, SAVE_SETTINGS_FILE_ERROR, "Failed to save application settings file.", "Saving the application settings file returned with an error.")
MAKE_ERROR_MSG(-1020, SAVE_CONFIG_FILE_ERROR, "Failed to save the config file.", "Saving the configuration file returned with an error.")
MAKE_ERROR_MSG(-1021, CANNOT_REMOVE_INSTALL_DIR, "Cannot remove existing installation directory.", "Failed to remove an existing installation directory.")
MAKE_ERROR_MSG(-1022, CREATE_INSTALL_DIR_ERROR, "Cannot create installation directory.", "Failed to create the installation directory.")
MAKE_ERROR_MSG(-1023, CREATE_TARGET_DIR_ERROR, "Cannot create target root directory.", "Failed to create the target root directory.")
MAKE_ERROR_MSG(-1024, CREATE_CONFIG_DIR_ERROR, "Cannot create config target directory.", "Failed to create the config target directory.")
MAKE_ERROR_MSG(-1026, NO_SOURCE_FILES, "No source files were found.", "No source files were found to add to the package.")
MAKE_ERROR_MSG(-1027, PACKAGE_CREATION_ERROR, "A compose package error has occurred.", "An error has occurred during the package creation.")
MAKE_ERROR_MSG(-1028, PACKAGE_READ_ERROR, "A read package error has occurred.", "An error has occurred while reading the package.")
MAKE_ERROR_MSG(-1017, CMDLN_INVALID_CONFIG_STRING, "The configuration string is invalid.", "The configuration string should consist of path (only for local) followed by '+component,component,...'.")
MAKE_ERROR_MSG(-1018, CMDLN_INVALID_PARAM_STRING, "The configuration parameter string is invalid or could not be parsed.", "The configuration string should consist of an component, a colon separator ':' followed by multiple parameters 'param1=value1,param2=value2,...'.")
MAKE_ERROR_MSG(-1019, CMDLN_INVALID_PARAM_FILE, "The configuration parameter TOML file could not be read.", "The configuration parameter TOML file contains errors or cannot be read.")
MAKE_ERROR_MSG(-1020, CMDLN_TOO_MANY_CONFIG_TARGETS, "Too many configuration targets were selected.", "Only one configuration target can be selected for configuration merging.")
MAKE_ERROR_MSG(-1021, CMDLN_MISSING_TARGET, "No target was provided.", "Cannot continue without target.")
MAKE_ERROR_MSG(-1030, SAVE_INSTALL_MANIFEST_ERROR, "Failed to save the installation manifest.", "Saving the installation manifest returned with an error.")
MAKE_ERROR_MSG(-1031, SAVE_SETTINGS_FILE_ERROR, "Failed to save application settings file.", "Saving the application settings file returned with an error.")
MAKE_ERROR_MSG(-1035, SAVE_CONFIG_FILE_ERROR, "Failed to save the config file.", "Saving the configuration file returned with an error.")
MAKE_ERROR_MSG(-1036, PARAMETERS_CONFIG_ERROR, "No instance could be found in the configuration to assign the parameters to or no configuration was selected at the command line.", "Storing parameters inside the configuration doesn't work.")
MAKE_ERROR_MSG(-1040, CANNOT_REMOVE_INSTALL_DIR, "Cannot remove existing installation directory.", "Failed to remove an existing installation directory.")
MAKE_ERROR_MSG(-1041, CREATE_INSTALL_DIR_ERROR, "Cannot create installation directory.", "Failed to create the installation directory.")
MAKE_ERROR_MSG(-1042, CREATE_TARGET_DIR_ERROR, "Cannot create target root directory.", "Failed to create the target root directory.")
MAKE_ERROR_MSG(-1043, CREATE_CONFIG_DIR_ERROR, "Cannot create config target directory.", "Failed to create the config target directory.")
MAKE_ERROR_MSG(-1050, NO_SOURCE_FILES, "No source files were found.", "No source files were found to add to the package.")
MAKE_ERROR_MSG(-1055, PACKAGE_CREATION_ERROR, "A compose package error has occurred.", "An error has occurred during the package creation.")
MAKE_ERROR_MSG(-1058, PACKAGE_READ_ERROR, "A read package error has occurred.", "An error has occurred while reading the package.")
MAKE_ERROR_MSG(-1060, CANNOT_READ_CONFIG, "The configuration cannot be read.", "An error has occurred while reading the configuration TOML.")
MAKE_ERROR_MSG(-1061, FAILED_UPDATING_CONFIG, "The configuration could not be updated.", "An error has occurred while updating the configuration TOML.")
MAKE_ERROR_MSG(-1062, PARTLY_FAILED_UPDATING_CONFIG, "The configuration could only be updated.", "Could not merge all entities in the target configuration.")
////////// SDV TRACE MONITOR ERROR CODES ////////////
MAKE_ERROR_MSG(-5500, TRACE_MON_REG_HNDLR_ERROR, "Failed to register application control handler.", "The OS returned an error during the registration of the application control handler.")

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:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Define project
project (sdv_control VERSION 1.0 LANGUAGES CXX)

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CONTEXT_H
#define CONTEXT_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "installation.h"
#include "../../global/cmdlnparser/cmdlnparser.h"
#include <interfaces/process.h>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef INSTALLATION_H
#define INSTALLATION_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "list_elements.h"
#include "print_table.h"
#include <interfaces/config.h>
@@ -211,23 +224,6 @@ int ListClasses(const SContext& rsContext, const sdv::TObjectPtr& rptrRepository
return MODULE_CONTROL_SERVICE_ACCESS_ERROR;
}
// Class type
auto fnPrintClassType = [](sdv::EObjectType eType)
{
switch (eType)
{
case sdv::EObjectType::SystemObject: return "SystemObject";
case sdv::EObjectType::Device: return "Device";
case sdv::EObjectType::BasicService: return "BasicService";
case sdv::EObjectType::ComplexService: return "ComplexService";
case sdv::EObjectType::Application: return "Application";
case sdv::EObjectType::Proxy: return "Proxy";
case sdv::EObjectType::Stub: return "Stub";
case sdv::EObjectType::Utility: return "Utility";
default: return "Unknown";
}
};
// Class flags
auto fnPrintClassFlags = [](uint32_t uiFlags)
{
@@ -263,7 +259,7 @@ int ListClasses(const SContext& rsContext, const sdv::TObjectPtr& rptrRepository
{
sdv::sequence<sdv::SClassInfo> seqClasses = pModuleInfo->GetClassList(rsModuleInfo.tModuleID);
for (const sdv::SClassInfo& rsClassInfo : seqClasses)
vecShortClassList.push_back({ rsClassInfo.ssClassName, fnPrintList(rsClassInfo.seqClassAliases) });
vecShortClassList.push_back({ rsClassInfo.ssName, fnPrintList(rsClassInfo.seqClassAliases) });
}
// Print the module list
@@ -279,10 +275,10 @@ int ListClasses(const SContext& rsContext, const sdv::TObjectPtr& rptrRepository
sdv::sequence<sdv::SClassInfo> seqClasses = pModuleInfo->GetClassList(rsModuleInfo.tModuleID);
for (const sdv::SClassInfo& rsClassInfo : seqClasses)
vecClassList.push_back({
rsClassInfo.ssClassName,
rsClassInfo.ssName,
fnPrintList(rsClassInfo.seqClassAliases),
rsClassInfo.ssDefaultObjectName,
fnPrintClassType(rsClassInfo.eType),
sdv::ObjectType2String(rsClassInfo.eType),
fnPrintClassFlags(rsClassInfo.uiFlags),
std::to_string(static_cast<int64_t>(rsModuleInfo.tModuleID)),
fnPrintList(rsClassInfo.seqDependencies) });
@@ -309,23 +305,6 @@ int ListComponents(const SContext& rsContext, const sdv::TObjectPtr& rptrReposit
return REPOSITORY_SERVICE_ACCESS_ERROR;
}
// Class type
auto fnPrintClassType = [](sdv::EObjectType eType)
{
switch (eType)
{
case sdv::EObjectType::SystemObject: return "SystemObject";
case sdv::EObjectType::Device: return "Device";
case sdv::EObjectType::BasicService: return "BasicService";
case sdv::EObjectType::ComplexService: return "ComplexService";
case sdv::EObjectType::Application: return "Application";
case sdv::EObjectType::Proxy: return "Proxy";
case sdv::EObjectType::Stub: return "Stub";
case sdv::EObjectType::Utility: return "Utility";
default: return "Unknown";
}
};
// Object flags
auto fnPrintObjectFlags = [](uint32_t uiFlags)
{
@@ -369,9 +348,9 @@ int ListComponents(const SContext& rsContext, const sdv::TObjectPtr& rptrReposit
for (const sdv::core::SObjectInfo& rsObjectInfo : seqObjects)
vecObjectList.push_back({
std::to_string(static_cast<int64_t>(rsObjectInfo.tModuleID)),
rsObjectInfo.sClassInfo.ssClassName,
rsObjectInfo.sClassInfo.ssName,
rsObjectInfo.ssObjectName,
fnPrintClassType(rsObjectInfo.sClassInfo.eType),
sdv::ObjectType2String(rsObjectInfo.sClassInfo.eType),
fnPrintObjectFlags(rsObjectInfo.uiFlags),
std::to_string(static_cast<int64_t>(rsObjectInfo.tModuleID)) });

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef LIST_ELEMENTS_H
#define LIST_ELEMENTS_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "../../global/process_watchdog.h"
#include <support/sdv_core.h>
#include "../../global/cmdlnparser/cmdlnparser.cpp"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef TABLE_H
#define TABLE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "start_stop_service.h"
#include "../../global/cmdlnparser/cmdlnparser.h"
#include <interfaces/process.h>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef START_STOP_SERVICE_H
#define START_STOP_SERVICE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "startup_shutdown.h"
#include "../../global/cmdlnparser/cmdlnparser.h"
#include <interfaces/process.h>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef STARTUP_SHUTDOWN_H
#define STARTUP_SHUTDOWN_H

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:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Define project
project(sdv_core VERSION 1.0 LANGUAGES CXX)

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include <support/sdv_core.h>
#include <atomic>
#include "../../global/cmdlnparser/cmdlnparser.cpp"

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:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Define project
project (sdv_dbc_util VERSION 1.0 LANGUAGES CXX)

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "can_dl.h"
#include <support/any.h>
#include <cmath>
@@ -167,7 +180,7 @@ const char szHdrTemplate[] = R"code(/**
/**
* @brief Data link class.
*/
class CDataLink : public sdv::CSdvObject, public sdv::IObjectControl, public sdv::can::IReceive
class CDataLink : public sdv::CSdvObject, public sdv::can::IReceive
{
public:
/**
@@ -182,38 +195,25 @@ public:
// Interface map
BEGIN_SDV_INTERFACE_MAP()
SDV_INTERFACE_ENTRY(sdv::IObjectControl)
SDV_INTERFACE_ENTRY(sdv::can::IReceive)
END_SDV_INTERFACE_MAP()
// Declarations
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::Device)
DECLARE_OBJECT_CLASS_TYPE(sdv::EObjectType::vehicle_bus)
DECLARE_OBJECT_CLASS_NAME("CAN_data_link")
DECLARE_DEFAULT_OBJECT_NAME("DataLink")
DECLARE_OBJECT_SINGLETON()
/**
* @brief Initialize the object. Overload of sdv::IObjectControl::Initialize.
* @param[in] ssObjectConfig Optional configuration string.
* @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.
*/
void Initialize(const sdv::u8string& ssObjectConfig) override;
virtual bool OnInitialize() override;
/**
* @brief Get the current status of the object. Overload of sdv::IObjectControl::GetStatus.
* @return Return the current status of the object.
* @brief Shutdown the object. Overload of sdv::CSdvObject::OnShutdown.
*/
sdv::EObjectStatus GetStatus() const override;
/**
* @brief Set the component operation mode. Overload of sdv::IObjectControl::SetOperationMode.
* @param[in] eMode The operation mode, the component should run in.
*/
void SetOperationMode(sdv::EOperationMode eMode) override;
/**
* @brief Shutdown called before the object is destroyed. Overload of sdv::IObjectControl::Shutdown.
*/
void Shutdown() override;
virtual void OnShutdown() override;
/**
* @brief Process a receive a CAN message. Overload of sdv::can::IReceive::Receive.
@@ -264,7 +264,6 @@ private:
double dValue; ///< 64-bit double precision floating point number.
};
%message_def%
sdv::EObjectStatus m_eStatus = sdv::EObjectStatus::initialization_pending; ///< Keep track of the object status.
size_t m_nIfcIndex = %ifc_index%; ///< CAN Interface index.
sdv::can::IRegisterReceiver* m_pRegister = nullptr; ///< CAN receiver registration interface.
sdv::can::ISend* m_pSend = nullptr; ///< CAN sender interface.
@@ -308,17 +307,14 @@ CDataLink::~CDataLink()
Shutdown(); // Just in case
}
void CDataLink::Initialize(const sdv::u8string& /*ssObjectConfig*/)
bool CDataLink::OnInitialize()
{
if (m_eStatus != sdv::EObjectStatus::initialization_pending) return;
// Get the CAN communication object.
sdv::TInterfaceAccessPtr ptrCANObject = sdv::core::GetObject("CAN_Communication_Object");
if (!ptrCANObject)
{
SDV_LOG_ERROR("CDataLink::Initialize() failure, 'CAN_Communication_Object' not found");
m_eStatus = sdv::EObjectStatus::initialization_failure;
return;
return false;
}
%init_ifc_index%// Get the CAN receiver registration interface.
@@ -326,8 +322,7 @@ void CDataLink::Initialize(const sdv::u8string& /*ssObjectConfig*/)
if (!m_pRegister)
{
SDV_LOG_ERROR("CDataLink::Initialize() failure, 'sdv::can::IRegisterReceiver' interface not found");
m_eStatus = sdv::EObjectStatus::initialization_failure;
return;
return false;
}
m_pRegister->RegisterReceiver(static_cast<sdv::can::IReceive*>(this));
@@ -336,42 +331,17 @@ void CDataLink::Initialize(const sdv::u8string& /*ssObjectConfig*/)
if (!m_pSend)
{
SDV_LOG_ERROR("CDataLink::Initialize() failure, 'sdv::can::ISend' interface not found");
m_eStatus = sdv::EObjectStatus::initialization_failure;
return;
return false;
}
// Initialize messages
bool bSuccess = true;%init_msg%
m_eStatus = bSuccess ? sdv::EObjectStatus::initialized : sdv::EObjectStatus::initialization_failure;
return bSuccess;
}
sdv::EObjectStatus CDataLink::GetStatus() const
void CDataLink::OnShutdown()
{
return m_eStatus;
}
void CDataLink::SetOperationMode(sdv::EOperationMode eMode)
{
switch (eMode)
{
case sdv::EOperationMode::configuring:
if (m_eStatus == sdv::EObjectStatus::running || m_eStatus == sdv::EObjectStatus::initialized)
m_eStatus = sdv::EObjectStatus::configuring;
break;
case sdv::EOperationMode::running:
if (m_eStatus == sdv::EObjectStatus::configuring || m_eStatus == sdv::EObjectStatus::initialized)
m_eStatus = sdv::EObjectStatus::running;
break;
default:
break;
}
}
void CDataLink::Shutdown()
{
m_eStatus = sdv::EObjectStatus::shutdown_in_progress;
// Unregister receiver interface.
if (m_pRegister) m_pRegister->UnregisterReceiver(static_cast<sdv::can::IReceive*>(this));
m_pRegister = nullptr;
@@ -379,9 +349,6 @@ void CDataLink::Shutdown()
m_pSend = nullptr;
// Terminate messages%term_msg%
// Update the status
m_eStatus = sdv::EObjectStatus::destruction_pending;
}
void CDataLink::Receive(/*in*/ [[maybe_unused]] const sdv::can::SMessage& sMsg, /*in*/ uint32_t uiIfcIndex)
@@ -605,8 +572,7 @@ std::string CCanDataLinkGen::CodeInitInterfaceIndex(const std::string& rssIfcNam
if (!pInfo)
{
// CAN information interface not found.
m_eStatus = sdv::EObjectStatus::initialization_failure;
return;
return false;
}
sdv::sequence<sdv::string> seqInterfaces = pInfo->GetInterfaces();
size_t nIndex = 0;
@@ -621,9 +587,10 @@ std::string CCanDataLinkGen::CodeInitInterfaceIndex(const std::string& rssIfcNam
if (nIndex >= seqInterfaces.size())
{
// Interface with supplied name not found.
m_eStatus = sdv::EObjectStatus::initialization_failure;
return;
return false;
}
return true;
)code", mapKeywords);
}
@@ -696,8 +663,9 @@ std::string CCanDataLinkGen::CodeTxMessageDefinition(const dbc::SMessageDef& rsM
/**
* @brief Initialize the message by registering all signals.
* @param[in] pSend The send-interface of the CAN.
* @param[in] nIfcIndex CAN Interface index.
*/
bool Init(sdv::can::ISend* pSend);
bool Init(sdv::can::ISend* pSend, size_t nIfcIndex);
/**
* @brief Terminate the message by unregistering all signals.
@@ -712,7 +680,8 @@ std::string CCanDataLinkGen::CodeTxMessageDefinition(const dbc::SMessageDef& rsM
sdv::core::CDispatchService& m_rdispatch; ///< Reference to the dispatch service.
sdv::core::CTrigger m_trigger; ///< Message trigger being called by the dispatch service.
sdv::can::ISend* m_pSend = nullptr; ///< Message sending interface.
sdv::can::ISend* m_pSend = nullptr; ///< Message sending interface.
size_t m_nIfcIndex = 0; ///< CAN Interface index.
%sig_decl%
} m_sTxMsg%msg_name%;
)code", mapKeywords);
@@ -759,7 +728,7 @@ std::string CCanDataLinkGen::CodeInitTxMessage(const dbc::SMessageDef& rsMsg)
mapKeywords["msg_name"] = rsMsg.ssName;
return ReplaceKeywords(R"code(
bSuccess &= m_sTxMsg%msg_name%.Init(m_pSend);)code", mapKeywords);
bSuccess &= m_sTxMsg%msg_name%.Init(m_pSend, m_nIfcIndex);)code", mapKeywords);
}
std::string CCanDataLinkGen::CodeTermRxMessage(const dbc::SMessageDef& rsMsg)
@@ -975,10 +944,14 @@ CDataLink::STxMsg_%msg_name%::STxMsg_%msg_name%(sdv::core::CDispatchService& rdi
m_rdispatch(rdispatch)
{}
bool CDataLink::STxMsg_%msg_name%::Init(sdv::can::ISend* pSend)
bool CDataLink::STxMsg_%msg_name%::Init(sdv::can::ISend* pSend, size_t nIfcIndex)
{
if (!pSend) return false;
if (!pSend)
{
return false;
}
m_pSend = pSend;
m_nIfcIndex = nIfcIndex;
// Register signals
bool bSuccess = true;%sig_register%
@@ -1020,8 +993,7 @@ void CDataLink::STxMsg_%msg_name%::Transmit()
transaction.Finish();
// Transmit the message
// TODO: Determine CAN interface index...
m_pSend->Send(msg, 0);
m_pSend->Send(msg, static_cast<uint32_t>(m_nIfcIndex));
}
)code", mapKeywords);
}

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CAN_DL_H
#define CAN_DL_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "cmake_generator.h"
#include <sstream>
#include <fstream>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CMAKE_GENERATOR_H
#define CMAKE_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "codegen_base.h"
#include <sstream>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CODEGEN_BASE_H
#define CODEGEN_BASE_H

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
********************************************************************************/
#include "fmu_templates.h"
#include "fmu_fmi_templates.h"
#include "fmu.h"

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
********************************************************************************/
#ifndef SOFTCAR_FMU_H
#define SOFTCAR_FMU_H

View File

@@ -1,3 +1,15 @@
/********************************************************************************
* 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 CoSimulation header template. File 'cosimulation.h'. Code chunks are inserted at the keywords surrounded by %%.

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 Build description template. File 'buildDescription.xml'. Code chunks are inserted at the keywords surrounded by %%.

View File

@@ -1,3 +1,17 @@
/********************************************************************************
* 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:
* Erik Verhoeven - initial API and implementation
* Thomas Pfleiderer - extended for FMU processing
********************************************************************************/
#include "../../global/process_watchdog.h"
#include <interfaces/core.h>
#include <interfaces/mem.h>

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:
# Erik Verhoeven - initial API and implementation
#*******************************************************************************
# Define project
project (sdv_idl_compiler VERSION 1.0 LANGUAGES CXX)

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "codepos.h"
#include "lexer.h"
#include "exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CODEPOS_H
#define CODEPOS_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "constvariant.h"
#include "constvariant.inl"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef VARIANT_H
#define VARIANT_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CONSTVARIANT_INL
#define CONSTVARIANT_INL

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef IDL_PARSER_INTERFACE_H
#define IDL_PARSER_INTERFACE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "attribute_entity.h"
CAttributeEntity::CAttributeEntity(const CContextPtr& rptrContext, CEntityPtr ptrParent, bool bReadOnly) :

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ATTRIBUTE_ENTITY_H
#define ATTRIBUTE_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "declaration_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef BASIC_TYPE_ENTITY_H
#define BASIC_TYPE_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "definition_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef DEFINITION_ENTITY_H
#define DEFINITION_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "entity_base.h"
#include "../parser.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ENTITY_BASE_H
#define ENTITY_BASE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "entity_value.h"
#include "../exception.h"
#include "variable_entity.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ENTITIY_VALUE_H
#define ENTITIY_VALUE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "enum_entity.h"
#include "entity_value.h"
#include "typedef_entity.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ENUM_ENTITY_H
#define ENUM_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "exception_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef EXCEPTION_ENTITY_H
#define EXCEPTION_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "hash_calc.h"
CHashObject::CHashObject()

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef HASH_CALC_H
#define HASH_CALC_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "interface_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef INTERFACE_ENTITY_H
#define INTERFACE_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "meta_entity.h"
CMetaEntity::CMetaEntity(const CContextPtr& rptrContext, CEntityPtr ptrParent, const CToken& rtokenMeta,

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef META_ENTITY_H
#define META_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "module_entity.h"
#include "typedef_entity.h"
#include "struct_entity.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef MODULE_ENTITY_H
#define MODULE_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "operation_entity.h"
#include "interface_entity.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef OPERATION_ENTITY_H
#define OPERATION_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "parameter_entity.h"
#include "interface_entity.h"
#include "operation_entity.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef PARAMETER_ENTITY_H
#define PARAMETER_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "root_entity.h"
#include "module_entity.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ROOT_ENTITY_H
#define ROOT_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "struct_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef STRUCT_ENTITY_H
#define STRUCT_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "typedef_entity.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef TYPEDEF_ENTITY_H
#define TYPEDEF_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "union_entity.h"
#include "../exception.h"
#include "../logger.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef UNION_ENTITY_H
#define UNION_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "variable_entity.h"
#include "typedef_entity.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef DECLARATOR_ENTITY_H
#define DECLARATOR_ENTITY_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "environment.h"
#include "lexer.h"
#include "codepos.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef ENV_H
#define ENV_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "exception.h"
#include <cassert>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef EXCEPTION_H
#define EXCEPTION_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "context.h"
#include "cmake_generator.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CMAKE_GENERATOR_H
#define CMAKE_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "context.h"
#include "../exception.h"
#include <cassert>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef CONTEXT_H
#define CONTEXT_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "definition_generator.h"
#include "../logger.h"
#include "../exception.h"
@@ -5,6 +18,76 @@
#include <cctype>
#include <thread>
#include <chrono>
#include <string_view>
#include <algorithm>
/**
* @brief Does the provided string represent a valid number - starting with a digit, 0x or 0b representing an hexa-decimal,
* decimal, octal or binary number comparable with C++?
* @remarks The original function used regular expressions. Two possible pattern came into question:
* @code
* ^(0x[0-9a-fA-F]+|0b[01]+|0[0-7]*|[1-9][0-9]*)$
* ^(?:0x[0-9a-fA-F]+|0b[01]+|0[0-7]*|[1-9][0-9]*)$
* @endcode
* Due to a bug in the MINGW libstd++ regex library, which hangs due to backtracing and stack-overflow issues while parsing these
* patterns, the implementation was replaced by a C++ function.
* @param[in] sv Sting view to the string to check.
* @return Returns whether the string view contains a valid number.
*/
inline bool IsValidIdlNumber(std::string_view sv)
{
if (sv.empty()) return false;
// 1. Hexadecimal: 0x... or 0X...
if (sv.size() > 2 && sv[0] == '0' && (sv[1] == 'x' || sv[1] == 'X'))
return sv.substr(2).find_first_not_of("0123456789abcdefABCDEF") == std::string_view::npos;
// 2. Binary: 0b... or 0B...
if (sv.size() > 2 && sv[0] == '0' && (sv[1] == 'b' || sv[1] == 'B'))
return sv.substr(2).find_first_not_of("01") == std::string_view::npos;
// 3. Octal or a zero: 0...
if (sv[0] == '0')
return sv.find_first_not_of("01234567") == std::string_view::npos;
// 4. Decimal: starts with 1-9, followed by 0-9
if (sv[0] >= '1' && sv[0] <= '9')
return sv.find_first_not_of("0123456789") == std::string_view::npos;
// Not a valid number
return false;
}
/**
* @brief Add std::move to complex data types.
* @param rssName Reference to the variable name.
* @param eDeclType Declaration type.
* @return The string with or without std::move.
*/
inline std::string MoveVarDeclType(const std::string& rssName, sdv::idl::EDeclType eDeclType)
{
switch (eDeclType)
{
case sdv::idl::EDeclType::decltype_string:
case sdv::idl::EDeclType::decltype_u8string:
case sdv::idl::EDeclType::decltype_u16string:
case sdv::idl::EDeclType::decltype_u32string:
case sdv::idl::EDeclType::decltype_wstring:
case sdv::idl::EDeclType::decltype_struct:
case sdv::idl::EDeclType::decltype_union:
case sdv::idl::EDeclType::decltype_pointer:
case sdv::idl::EDeclType::decltype_sequence:
case sdv::idl::EDeclType::decltype_map:
case sdv::idl::EDeclType::decltype_bitset:
case sdv::idl::EDeclType::decltype_bitfield:
case sdv::idl::EDeclType::decltype_bitmask:
case sdv::idl::EDeclType::decltype_any:
return "std::move(" + rssName + ")";
default:
return rssName;
}
}
CDefinitionContext::CDefinitionContext(const CGenContext& rGenContext, sdv::IInterfaceAccess* pEntity) :
CDefEntityContext<CDefinitionContext>(rGenContext, pEntity), m_bPreface(true)
@@ -647,11 +730,24 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
rcontext.GetDefCodeStream() << MapDeclType2CType(eBaseType);
}
// Code streams
std::stringstream sstreamConstructorImpl;
std::stringstream sstreamCopyConstructImpl;
std::stringstream sstreamCopyConstructInitializers;
std::stringstream sstreamCopyOperatorImpl;
std::stringstream sstreamMoveConstructImpl;
std::stringstream sstreamMoveConstructInitializers;
std::stringstream sstreamMoveOperatorImpl;
std::stringstream sstreamDestructorImpl;
std::stringstream sstreamPrivateFunc;
std::stringstream sstreamPublicFunc;
bool bCopyMoveConstructNeeded = false;
// Start content
rcontext.GetDefCodeStream() << std::endl << rcontext.GetIndent() << "{" << std::endl;
rcontext.IncrIndent();
// Run through the declarations and add each declaration. Add the definition before the declaration if there is one to be added.
// Run through the declarations and check for an exception definitions defining a description.
sdv::idl::IEntityIterator* pChildIterator = pDefinition ? pDefinition->GetChildren() : nullptr;
bool bContainsConstDescription = false;
for (uint32_t uiIndex = 0; !bInline && pChildIterator && uiIndex < pChildIterator->GetCount(); uiIndex++)
@@ -673,10 +769,10 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
// Check for const variable
if (!pChildDeclarationEntity->IsReadOnly())
throw CCompileException("Exception definition declares '_description' member; this member must be a "
"const-variable.");
"const-variable.");
if (pChildDeclType->GetBaseType() != sdv::idl::EDeclType::decltype_char || !pChildDeclarationEntity->HasArray())
throw CCompileException("Exception definition declares '_description' member; "
"this member must be of char array (char[]) type.");
"this member must be of char array (char[]) type.");
bContainsConstDescription = true;
}
}
@@ -751,6 +847,127 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
// NOTE: Compound definitions are all definitions except modules.
if (pChildIterator && !ProcessEntities(sContentStreamContext, pChildIterator)) return;
// Get the switch code context list
auto vecSwitchCodeContext = sContentStreamContext.GetSwitchCodeContexts<SDefinitionSwitchCodeContext>();
// Add copy and move construction code.
for (uint32_t uiIndex = 0; !bInline && pChildIterator && uiIndex < pChildIterator->GetCount(); uiIndex++)
{
sdv::IInterfaceAccess* pChildEntity = pChildIterator->GetEntityByIndex(uiIndex);
if (!pChildEntity) continue;
const sdv::idl::IEntityInfo* pChildEntityInfo = pChildEntity->GetInterface<sdv::idl::IEntityInfo>();
if (!pChildEntityInfo) continue;
// Is the entity a declaration?
sdv::idl::IDeclarationEntity* pChildDeclarationEntity = pChildEntity->GetInterface<sdv::idl::IDeclarationEntity>();
if (!pChildDeclarationEntity) continue;
sdv::IInterfaceAccess* pChildDeclTypeObj = pChildDeclarationEntity->GetDeclarationType();
if (!pChildDeclTypeObj) continue;
const sdv::idl::IDeclarationType* pChildDeclType = pChildDeclTypeObj->GetInterface<sdv::idl::IDeclarationType>();
if (!pChildDeclType) continue;
if ((pChildDeclType->GetBaseType() != sdv::idl::EDeclType::decltype_union) && !pChildDeclarationEntity->IsReadOnly() &&
std::find_if(vecSwitchCodeContext.begin(), vecSwitchCodeContext.end(),
[&](const std::shared_ptr<SDefinitionSwitchCodeContext>& ptrSwitchCodeContext)
{
return ptrSwitchCodeContext && ptrSwitchCodeContext->ssSwitchVarName == pChildEntityInfo->GetName();
}) == vecSwitchCodeContext.end())
{
// Is this an array?
if (pChildDeclarationEntity->HasArray())
{
// Automatic indentation
auto fnLocalIndent = [&](size_t nSteps)
{
std::string m_ssIndent = sContentStreamContext.GetIndent();
for (size_t n = 0; n < nSteps; n++)
m_ssIndent += GetIndentChars();
return m_ssIndent;
};
// Create the limiter string
auto fnLimiter = [&](const std::string& rssExpression)
{
if (IsValidIdlNumber(rssExpression)) return rssExpression;
return "static_cast<size_t>(" + GetRelativeScopedName(rssExpression, sContentStreamContext.GetScope()) + ")";
};
// Iterate through the array dimensions
auto seqDimensions = pChildDeclarationEntity->GetArrayDimensions();
std::stringstream sstreamIteration, sstreamIndexRef;
size_t nDepth = 0;
for (auto sDimension : seqDimensions)
{
std::string ssArrayIterator = std::string("nIndex_") + pChildEntityInfo->GetName();
if (seqDimensions.size() > 1) ssArrayIterator += std::to_string(nDepth++);
sstreamIteration << fnLocalIndent(nDepth) << "for (size_t " << ssArrayIterator << " = 0; " <<
ssArrayIterator << " < " << fnLimiter(sDimension.ssExpression) << "; ++" << ssArrayIterator << ")" <<
std::endl << fnLocalIndent(nDepth) << "{" << std::endl;
sstreamIndexRef << "[" << ssArrayIterator << "]";
if (nDepth == seqDimensions.size())
{
sstreamCopyConstructImpl << sstreamIteration.str();
sstreamMoveConstructImpl << sstreamIteration.str();
sstreamCopyOperatorImpl << sstreamIteration.str();
sstreamMoveOperatorImpl << sstreamIteration.str();
++nDepth;
sstreamCopyConstructImpl << fnLocalIndent(nDepth) << pChildEntityInfo->GetName() <<
sstreamIndexRef.str() << " = rvar." << pChildEntityInfo->GetName() << sstreamIndexRef.str() << ";" <<
std::endl;
sstreamMoveConstructImpl << fnLocalIndent(nDepth) << pChildEntityInfo->GetName() <<
sstreamIndexRef.str() << " = " <<
MoveVarDeclType("rvar." + pChildEntityInfo->GetName() + sstreamIndexRef.str(),
pChildDeclType->GetBaseType()) << ";" << std::endl;
sstreamCopyOperatorImpl << fnLocalIndent(nDepth) << pChildEntityInfo->GetName() <<
sstreamIndexRef.str() << " = rvar." << pChildEntityInfo->GetName() << sstreamIndexRef.str() << ";" <<
std::endl;
sstreamMoveOperatorImpl << fnLocalIndent(nDepth) << pChildEntityInfo->GetName() <<
sstreamIndexRef.str() << " = " <<
MoveVarDeclType("rvar." + pChildEntityInfo->GetName() + sstreamIndexRef.str(),
pChildDeclType->GetBaseType()) << ";" << std::endl;
--nDepth;
}
}
// Stop array iteration if the union was allocated using a single or multi dimensional array
while (nDepth)
{
sstreamCopyConstructImpl << fnLocalIndent(nDepth) << "}" << std::endl;
sstreamMoveConstructImpl << fnLocalIndent(nDepth) << "}" << std::endl;
sstreamCopyOperatorImpl << fnLocalIndent(nDepth) << "}" << std::endl;
sstreamMoveOperatorImpl << fnLocalIndent(nDepth) << "}" << std::endl;
--nDepth;
}
}
else if (pChildEntityInfo->GetType() != sdv::idl::EEntityType::type_case_entry)
{
// Copy constructor initialization
if (sstreamCopyConstructInitializers.str().empty())
sstreamCopyConstructInitializers << " :" << std::endl;
else
sstreamCopyConstructInitializers << "," << std::endl;
sstreamCopyConstructInitializers << sContentStreamContext.GetIndent(true, true) << pChildEntityInfo->GetName()
<< "(rvar." << pChildEntityInfo->GetName() << ")";
// Move constructor initialization
if (sstreamMoveConstructInitializers.str().empty())
sstreamMoveConstructInitializers << " :" << std::endl;
else
sstreamMoveConstructInitializers << "," << std::endl;
sstreamMoveConstructInitializers << sContentStreamContext.GetIndent(true, true) << pChildEntityInfo->GetName() <<
"(" << MoveVarDeclType("rvar." + pChildEntityInfo->GetName(), pChildDeclType->GetBaseType()) << ")";
// Copy operator
sstreamCopyOperatorImpl << sContentStreamContext.GetIndent(true, true) << pChildEntityInfo->GetName() <<
" = rvar." << pChildEntityInfo->GetName() << ";" << std::endl;
// Move operator
sstreamMoveOperatorImpl << sContentStreamContext.GetIndent(true, true) << pChildEntityInfo->GetName() <<
" = " << MoveVarDeclType("rvar." + pChildEntityInfo->GetName(), pChildDeclType->GetBaseType()) << ";" <<
std::endl;
}
}
}
// Add the what-function to the exception
if (pEntityInfo->GetType() == sdv::idl::EEntityType::type_exception)
{
@@ -780,17 +997,10 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
}
// Build the code streams from any switch variables
std::stringstream sstreamConstructorImpl;
std::stringstream sstreamCopyConstructImpl;
std::stringstream sstreamMoveConstructImpl;
std::stringstream sstreamDestructorImpl;
std::stringstream sstreamPrivateFunc;
std::stringstream sstreamPublicFunc;
for (const auto& rptrSwitchCodeContext : sContentStreamContext.GetSwitchCodeContexts<SDefinitionSwitchCodeContext>())
for (const auto& rptrSwitchCodeContext : vecSwitchCodeContext)
{
std::string ssSwitchVarName = rptrSwitchCodeContext->ssSwitchVarName;
std::string ssSwitchVarType = rptrSwitchCodeContext->ptrSwitchVar->ssType;
//std::string ssSwitchVarValue;
// Create a stream of constructor implementation code
if (!rptrSwitchCodeContext->sstreamConstructorImpl.str().empty())
@@ -813,10 +1023,7 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
sstreamPrivateFunc << sContentStreamContext.GetIndent(false) << "void construct_" << QualifyName(ssSwitchVarName);
sstreamPrivateFunc << "(";
sstreamPrivateFunc << ssSwitchVarType << " val = ";
//if (!ssSwitchVarValue.empty())
// sstreamPrivateFunc << ssSwitchVarValue;
//else
sstreamPrivateFunc << ssSwitchVarType << "{}";
sstreamPrivateFunc << ssSwitchVarType << "{}";
sstreamPrivateFunc << ")" << std::endl << sContentStreamContext.GetIndent(false) << "{" << std::endl;
sstreamPrivateFunc << sContentStreamContext.GetIndent(false, true) << ssSwitchVarName << " = val;" << std::endl;
sstreamPrivateFunc <<
@@ -824,28 +1031,47 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
sstreamPrivateFunc << sContentStreamContext.GetIndent(false) << "}" << std::endl;
}
// Create copy constructor impl for the switch type
// Create copy constructor/operator impl for the switch type
if (!rptrSwitchCodeContext->sstreamCopyConstructHelperImpl.str().empty())
{
// Constructor
if (!sstreamCopyConstructImpl.str().empty())
sstreamCopyConstructImpl << std::endl;
sstreamCopyConstructImpl << sContentStreamContext.GetIndent(false, true) << "// Construct content based on " <<
ssSwitchVarName << std::endl;
sstreamCopyConstructImpl <<
SmartIndent(rptrSwitchCodeContext->sstreamCopyConstructHelperImpl.str(),
sContentStreamContext.GetIndent(false, true));
sstreamCopyConstructImpl << SmartIndent(rptrSwitchCodeContext->sstreamCopyConstructHelperImpl.str(),
sContentStreamContext.GetIndent(false, true));
// Operator
if (!sstreamCopyOperatorImpl.str().empty())
sstreamCopyOperatorImpl << std::endl;
sstreamCopyOperatorImpl << sContentStreamContext.GetIndent(false, true) << "// Construct content based on " <<
ssSwitchVarName << std::endl;
sstreamCopyOperatorImpl << SmartIndent(rptrSwitchCodeContext->sstreamCopyConstructHelperImpl.str(),
sContentStreamContext.GetIndent(false, true));
bCopyMoveConstructNeeded = true;
}
// Create move constructor impl for the switch type
// Create move constructor/operator impl for the switch type
if (!rptrSwitchCodeContext->sstreamMoveConstructHelperImpl.str().empty())
{
// Constructor
if (!sstreamMoveConstructImpl.str().empty())
sstreamMoveConstructImpl << std::endl;
sstreamMoveConstructImpl << sContentStreamContext.GetIndent(false, true) << "// Construct content based on " <<
ssSwitchVarName << std::endl;
sstreamMoveConstructImpl <<
SmartIndent(rptrSwitchCodeContext->sstreamMoveConstructHelperImpl.str(),
sstreamMoveConstructImpl << SmartIndent(rptrSwitchCodeContext->sstreamMoveConstructHelperImpl.str(),
sContentStreamContext.GetIndent(false, true));
bCopyMoveConstructNeeded = true;
// Operator
if (!sstreamMoveOperatorImpl.str().empty())
sstreamMoveOperatorImpl << std::endl;
sstreamMoveOperatorImpl << sContentStreamContext.GetIndent(false, true) << "// Construct content based on " <<
ssSwitchVarName << std::endl;
sstreamMoveOperatorImpl << SmartIndent(rptrSwitchCodeContext->sstreamMoveConstructHelperImpl.str(),
sContentStreamContext.GetIndent(false, true));
bCopyMoveConstructNeeded = true;
}
// Create destructor helper function
@@ -894,9 +1120,6 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
sstreamPublicFunc << sContentStreamContext.GetIndent(false, true) << "// Anything to do?" << std::endl;
sstreamPublicFunc << sContentStreamContext.GetIndent(false, true) << "if (" << ssSwitchVarName <<
" == val) return;" << std::endl;
//sstreamPublicFunc << sContentStreamContext.GetIndent(false, true) << "// Assign the new value..." << std::endl;
//sstreamPublicFunc << sContentStreamContext.GetIndent(false, true) <<
// rptrSwitchCodeContext->ssSwitchVarName << " = val;" << std::endl;
sstreamPublicFunc << SmartIndent(rptrSwitchCodeContext->sstreamCode.str(), sContentStreamContext.GetIndent(false, true));
sstreamPublicFunc << sContentStreamContext.GetIndent(false) << "}" << std::endl << std::endl;
@@ -923,11 +1146,11 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
{
if (!ssConstructorImpl.empty())
{
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
<< "// No initialization of variables is done in the constructor; suppress cppcheck warning."
<< std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
<< "// cppcheck-suppress uninitMemberVar" << std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
// << "// No initialization of variables is done in the constructor; suppress cppcheck warning."
// << std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
// << "// cppcheck-suppress uninitMemberVar" << std::endl;
}
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "/** Constructor */" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << pEntityInfo->GetName() << "()";
@@ -943,17 +1166,20 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
rcontext.GetDefCodeStream() << std::endl;
}
// Stream copy constructor function
std::string ssCopyConstructImpl = sstreamCopyConstructImpl.str();
// Stream copy constructor function (if required)
std::string ssCopyConstructImpl;
std::string ssCopyConstructInitializers = sstreamCopyConstructInitializers.str();
if (bCopyMoveConstructNeeded)
ssCopyConstructImpl = sstreamCopyConstructImpl.str();
if (sContentStreamContext.NeedsConstruction() || !ssCopyConstructImpl.empty())
{
if (!ssCopyConstructImpl.empty())
{
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
false) << "// No initialization of variables is done in the constructor; suppress cppcheck warning."
<< std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress uninitMemberVar"
<< std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
// false) << "// No initialization of variables is done in the constructor; suppress cppcheck warning."
// << std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress uninitMemberVar"
// << std::endl;
}
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "/**" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " * Copy constructor " << std::endl;
@@ -964,12 +1190,20 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
if (ssCopyConstructImpl.empty())
rcontext.GetDefCodeStream() << "[[maybe_unused]] ";
rcontext.GetDefCodeStream() << "const " << pEntityInfo->GetName() << "& rvar)";
if (ssCopyConstructImpl.empty())
rcontext.GetDefCodeStream() << " {}" << std::endl;
if (!ssCopyConstructInitializers.empty())
rcontext.GetDefCodeStream() << ssCopyConstructInitializers << std::endl << sContentStreamContext.GetIndent(false);
else
{
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "{" << std::endl;
if (ssCopyConstructImpl.empty())
rcontext.GetDefCodeStream() << " ";
else
rcontext.GetDefCodeStream() << std::endl;
}
if (ssCopyConstructImpl.empty())
rcontext.GetDefCodeStream() << "{}" << std::endl;
else
{
rcontext.GetDefCodeStream() << "{" << std::endl;
rcontext.GetDefCodeStream() << ssCopyConstructImpl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "}" << std::endl;
}
@@ -977,16 +1211,19 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
}
// Stream move constructor function
std::string ssMoveConstructImpl = sstreamMoveConstructImpl.str();
std::string ssMoveConstructImpl;
std::string ssMoveConstructInitializers = sstreamMoveConstructInitializers.str();
if (bCopyMoveConstructNeeded)
ssMoveConstructImpl = sstreamMoveConstructImpl.str();
if (sContentStreamContext.NeedsConstruction() || !ssMoveConstructImpl.empty())
{
if (!ssMoveConstructImpl.empty())
{
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
false) << "// No initialization of variables is done in the constructor; suppress cppcheck warning."
<< std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress uninitMemberVar"
<< std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
// false) << "// No initialization of variables is done in the constructor; suppress cppcheck warning."
// << std::endl;
//rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress uninitMemberVar"
// << std::endl;
}
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "/**" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " * Move constructor " << std::endl;
@@ -997,12 +1234,20 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
if (ssMoveConstructImpl.empty())
rcontext.GetDefCodeStream() << "[[maybe_unused]] ";
rcontext.GetDefCodeStream() << pEntityInfo->GetName() << "&& rvar) noexcept";
if (ssMoveConstructImpl.empty())
rcontext.GetDefCodeStream() << " {}" << std::endl;
if (!ssMoveConstructInitializers.empty())
rcontext.GetDefCodeStream() << ssMoveConstructInitializers << std::endl << sContentStreamContext.GetIndent(false);
else
{
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "{" << std::endl;
if (ssMoveConstructImpl.empty())
rcontext.GetDefCodeStream() << " ";
else
rcontext.GetDefCodeStream() << std::endl;
}
if (ssMoveConstructImpl.empty())
rcontext.GetDefCodeStream() << "{}" << std::endl;
else
{
rcontext.GetDefCodeStream() << "{" << std::endl;
rcontext.GetDefCodeStream() << ssMoveConstructImpl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "}" << std::endl;
}
@@ -1028,16 +1273,19 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
}
// Stream assignment operator function
if (sContentStreamContext.NeedsConstruction() || !ssCopyConstructImpl.empty())
std::string ssCopyOperatorImpl;
if (bCopyMoveConstructNeeded)
ssCopyOperatorImpl = sstreamCopyOperatorImpl.str();
if (sContentStreamContext.NeedsConstruction() || !ssCopyOperatorImpl.empty())
{
if (!ssCopyConstructImpl.empty())
{
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
false) << "// Assignment of variables is done in a member function; suppress cppcheck warning."
<< std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress operatorEqVarError"
<< std::endl;
}
//if (!ssCopyOperatorImpl.empty())
//{
// rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(
// false) << "// Assignment of variables is done in a member function; suppress cppcheck warning."
// << std::endl;
// rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress operatorEqVarError"
// << std::endl;
//}
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "/**" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
<< " * Assignment operator" << std::endl;
@@ -1048,10 +1296,10 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " */" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << pEntityInfo->GetName() <<
"& operator=(";
if (ssCopyConstructImpl.empty())
if (ssCopyOperatorImpl.empty())
rcontext.GetDefCodeStream() << "[[maybe_unused]] ";
rcontext.GetDefCodeStream() << "const " << pEntityInfo->GetName() << " & rvar)";
if (ssCopyConstructImpl.empty())
if (ssCopyOperatorImpl.empty())
rcontext.GetDefCodeStream() << " { return *this; }" << std::endl;
else
{
@@ -1061,7 +1309,7 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
std::endl;
rcontext.GetDefCodeStream() << ssDestructorImpl;
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << ssCopyConstructImpl;
rcontext.GetDefCodeStream() << ssCopyOperatorImpl;
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false, true) << "return *this;" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "}" << std::endl;
@@ -1070,16 +1318,19 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
}
// Stream move operator function
if (sContentStreamContext.NeedsConstruction() || !ssMoveConstructImpl.empty())
std::string ssMoveOperatorImpl;
if (bCopyMoveConstructNeeded)
ssMoveOperatorImpl = sstreamMoveOperatorImpl.str();
if (sContentStreamContext.NeedsConstruction() || !ssMoveOperatorImpl.empty())
{
if (!ssMoveConstructImpl.empty())
{
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
<< "// Assignment of variables is done in a member function; suppress cppcheck warning."
<< std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress operatorEqVarError"
<< std::endl;
}
//if (!ssMoveOperatorImpl.empty())
//{
// rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false)
// << "// Assignment of variables is done in a member function; suppress cppcheck warning."
// << std::endl;
// rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "// cppcheck-suppress operatorEqVarError"
// << std::endl;
//}
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "/**" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " * Move operator" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " * @param[in] rvar Reference to the " <<
@@ -1089,10 +1340,10 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << " */" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << pEntityInfo->GetName() <<
"& operator=(";
if (ssMoveConstructImpl.empty())
if (ssMoveOperatorImpl.empty())
rcontext.GetDefCodeStream() << "[[maybe_unused]] ";
rcontext.GetDefCodeStream() << pEntityInfo->GetName() << "&& rvar) noexcept";
if (ssMoveConstructImpl.empty())
if (ssMoveOperatorImpl.empty())
rcontext.GetDefCodeStream() << " { return *this; }" << std::endl;
else
{
@@ -1102,7 +1353,7 @@ void CDefinitionGenerator::StreamDefinition(CDefinitionContext& rcontext, sdv::I
std::endl;
rcontext.GetDefCodeStream() << ssDestructorImpl;
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << ssMoveConstructImpl;
rcontext.GetDefCodeStream() << ssMoveOperatorImpl;
rcontext.GetDefCodeStream() << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false, true) << "return *this;" << std::endl;
rcontext.GetDefCodeStream() << sContentStreamContext.GetIndent(false) << "}" << std::endl;
@@ -1578,22 +1829,22 @@ void CDefinitionGenerator::ProcessUnionInContainerContext(CDefinitionContext& rc
// Start array iteration if the union was allocated using a single or multi dimensional array
for (const auto& rsArrayIndex : rvecArrayIndices)
{
rsstreamConstructHelperImpl << fnLocalIndent() << "for (uint32_t " << rsArrayIndex.ssArrayIterator << " = 0; " <<
rsArrayIndex.ssArrayIterator << " < " <<
GetRelativeScopedName(rsArrayIndex.ssCountExpression, rcontext.GetScope()) << "; " <<
rsArrayIndex.ssArrayIterator << "++)" << std::endl << fnLocalIndent() << "{" << std::endl;
rsstreamCopyConstructHelperImpl << fnLocalIndent() << "for (uint32_t " << rsArrayIndex.ssArrayIterator << " = 0; " <<
rsArrayIndex.ssArrayIterator << " < " <<
GetRelativeScopedName(rsArrayIndex.ssCountExpression, rcontext.GetScope()) << "; " <<
rsArrayIndex.ssArrayIterator << "++)" << std::endl << fnLocalIndent() << "{" << std::endl;
rsstreamMoveConstructHelperImpl << fnLocalIndent() << "for (uint32_t " << rsArrayIndex.ssArrayIterator << " = 0; " <<
rsArrayIndex.ssArrayIterator << " < " <<
GetRelativeScopedName(rsArrayIndex.ssCountExpression, rcontext.GetScope()) << "; " <<
rsArrayIndex.ssArrayIterator << "++)" << std::endl << fnLocalIndent() << "{" << std::endl;
rsstreamDestructHelperImpl << fnLocalIndent() << "for (uint32_t " << rsArrayIndex.ssArrayIterator << " = 0; " <<
rsArrayIndex.ssArrayIterator << " < " <<
GetRelativeScopedName(rsArrayIndex.ssCountExpression, rcontext.GetScope()) << "; " <<
rsArrayIndex.ssArrayIterator << "++)" << std::endl << fnLocalIndent() << "{" << std::endl;
// Create the limiter string
auto fnLimiter = [&]()
{
if (IsValidIdlNumber(rsArrayIndex.ssCountExpression))
return rsArrayIndex.ssCountExpression;
return "static_cast<size_t>(" + GetRelativeScopedName(rsArrayIndex.ssCountExpression, rcontext.GetScope()) + ")";
};
std::stringstream sstreamInteratorCode;
sstreamInteratorCode << fnLocalIndent() << "for (size_t " << rsArrayIndex.ssArrayIterator << " = 0; " <<
rsArrayIndex.ssArrayIterator << " < " << fnLimiter() << "; ++" << rsArrayIndex.ssArrayIterator << ")" << std::endl <<
fnLocalIndent() << "{" << std::endl;
rsstreamConstructHelperImpl << sstreamInteratorCode.str();
rsstreamCopyConstructHelperImpl << sstreamInteratorCode.str();
rsstreamMoveConstructHelperImpl << sstreamInteratorCode.str();
rsstreamDestructHelperImpl << sstreamInteratorCode.str();
nLocalIndent++;
}

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef DEFINITION_GENERATOR_H
#define DEFINITION_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef DEFINITION_GENERATOR_BASE_H
#define DEFINITION_GENERATOR_BASE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef DEFINITION_GENERATOR_BASE_INL
#define DEFINITION_GENERATOR_BASE_INL
@@ -515,7 +528,7 @@ inline void CDefinitionGeneratorBase<TDefEntityContext>::DetectUnionContainerFor
for (const sdv::idl::SArrayDimension& rsDimension : seqArrayDimensions)
{
// Create an index variable name
std::string ssIndexVarName = std::string("uiIndex_") + pEntityInfo->GetName();
std::string ssIndexVarName = std::string("nIndex_") + pEntityInfo->GetName();
if (seqArrayDimensions.size() > 1) ssIndexVarName += std::to_string(nIndex++);
vecNewInicesInfo.push_back(SArrayIterationInfo{ ssIndexVarName, rsDimension.ssExpression });
ssDeclMemberScope += std::string("[") + ssIndexVarName + "]";

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "proxy_generator.h"
#include "../exception.h"
#include <fstream>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef PROXY_GENERATOR_H
#define PROXY_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "ps_class_generator_base.h"
#include "../exception.h"
#include <fstream>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef PS_CLASS_GENERATOR_BASE_H
#define PS_CLASS_GENERATOR_BASE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "context.h"
#include "ps_cpp_generator.h"
#include "../exception.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef PS_CPP_GENERATOR_H
#define PS_CPP_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "serdes_generator.h"
#include "../logger.h"
#include <cassert>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef SERDES_GENERATOR_H
#define SERDES_GENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "stub_generator.h"
#include "../exception.h"
#include <fstream>

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef STUB_GTENERATOR_H
#define STUB_GTENERATOR_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef INCLUDES_IDL_COMPILER_H
#define INCLUDES_IDL_COMPILER_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "lexer.h"
#include "exception.h"
#include "support.h"

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef LEXER_H
#define LEXER_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef LEXERBASE_H
#define LEXERBASE_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "logger.h"
#ifdef _MSC_VER

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#ifndef LOGGER_H
#define LOGGER_H

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:
* Erik Verhoeven - initial API and implementation
********************************************************************************/
#include "macro.h"
#include "exception.h"
#include "lexer.h"
@@ -138,7 +151,7 @@ std::string CMacro::Expand(const CIdlCompilerEnvironment& renv, const CToken& rt
// Circular references to macros within the expanded code are prevented for
// - each paramerer separately with the used macro list provided by the function.
// - macro expansion result with the used macros from all the parameters and the used macro list provided to the function.
// Macros used in the expansion of the paramters and the results are added to the used macro set provided to this function.
// Macros used in the expansion of the parameters and the results are added to the used macro set provided to this function.
// Check whether the amount of provided params corresponds to the amount of param definitions.
if (rvecParams.size() < m_vecParamDefs.size())

Some files were not shown because too many files have changed in this diff Show More