diff --git a/CHANGES b/CHANGES index 0dd9ca7..3262e8d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,10 @@ Changes ======= +v3.1.11.1 +- Support deployment for anonymous arrays + +v3.1.11 +- Fixed segfault when unsubscribing inside subscription handler v3.1.10 - Upgrade to JDK-1.8. diff --git a/CommonAPI-Examples/src/C/MergedInterfaceClientC.cpp b/CommonAPI-Examples/src/C/MergedInterfaceClientC.cpp index dbf339e..e59cb44 100644 --- a/CommonAPI-Examples/src/C/MergedInterfaceClientC.cpp +++ b/CommonAPI-Examples/src/C/MergedInterfaceClientC.cpp @@ -27,7 +27,7 @@ int main() { std::shared_ptr < CommonAPI::Runtime > runtime = CommonAPI::Runtime::get(); std::string domain = "local"; - std::string instance = "commonapi.examples.C.AttributesC"; + std::string instance = "commonapi.examples.C.MergedInterfaceC"; std::string connection = "client-sample"; auto myProxy = runtime->buildProxyWithDefaultAttributeExtension(domain, instance, connection); diff --git a/org.genivi.commonapi.someip.ui/src/org/genivi/commonapi/someip/ui/handler/SomeIPGenerationCommand.java b/org.genivi.commonapi.someip.ui/src/org/genivi/commonapi/someip/ui/handler/SomeIPGenerationCommand.java index 61626bb..7de0092 100644 --- a/org.genivi.commonapi.someip.ui/src/org/genivi/commonapi/someip/ui/handler/SomeIPGenerationCommand.java +++ b/org.genivi.commonapi.someip.ui/src/org/genivi/commonapi/someip/ui/handler/SomeIPGenerationCommand.java @@ -20,7 +20,6 @@ import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.xtext.builder.EclipseResourceFileSystemAccess2; import org.franca.deploymodel.dsl.fDeploy.FDModel; -import org.genivi.commonapi.core.preferences.PreferenceConstants; import org.genivi.commonapi.core.ui.handler.GenerationCommand; import org.genivi.commonapi.someip.deployment.validator.SomeIPDeploymentValidator; import org.genivi.commonapi.someip.preferences.FPreferencesSomeIP; @@ -53,8 +52,8 @@ protected EclipseResourceFileSystemAccess2 createFileSystemAccess() { @Override protected void setupOutputDirectories(EclipseResourceFileSystemAccess2 fileSystemAccess) { fileSystemAccess.setOutputConfigurations(FPreferencesSomeIP.getInstance().getOutputpathConfiguration()); - } - + } + /** * Set the properties for the code generation from the resource properties (set with the property page, via the context menu). * Take default values from the eclipse preference page. @@ -112,7 +111,7 @@ public void initSomeIpPreferences(IFile file, IPreferenceStore store) licenseHeader = store.getString(PreferenceConstantsSomeIP.P_LICENSE_SOMEIP); } if(generateCommon == null) { - generateCommon = store.getString(PreferenceConstantsSomeIP.P_GENERATE_COMMON_SOMEIP); + generateCommon = store.getString(PreferenceConstantsSomeIP.P_GENERATE_COMMON_SOMEIP); } if(generateProxy == null) { generateProxy = store.getString(PreferenceConstantsSomeIP.P_GENERATEPROXY_SOMEIP); diff --git a/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeArtifacts.xml b/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeArtifacts.xml new file mode 100644 index 0000000..e65ef62 --- /dev/null +++ b/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeArtifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeContent.xml b/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeContent.xml new file mode 100644 index 0000000..9a45538 --- /dev/null +++ b/org.genivi.commonapi.someip.updatesite/composite_update_site/compositeContent.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/org.genivi.commonapi.someip.validator/plugin.xml b/org.genivi.commonapi.someip.validator/plugin.xml index af91691..335b5e6 100644 --- a/org.genivi.commonapi.someip.validator/plugin.xml +++ b/org.genivi.commonapi.someip.validator/plugin.xml @@ -14,7 +14,7 @@ + name="CommonAPI-Some/IP Validator"> diff --git a/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/ValidatorSomeIP.java b/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/ValidatorSomeIP.java index 3f51f2f..d719220 100644 --- a/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/ValidatorSomeIP.java +++ b/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/ValidatorSomeIP.java @@ -20,7 +20,6 @@ import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; -import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; @@ -141,10 +140,9 @@ public void validateModel(FModel model, ValidationMessageAcceptor messageAccepto } - HashMap> managedInterfaces = new HashMap>(); + cwd = filePath.removeLastSegments(1).toString(); for (FInterface fInterface : model.getInterfaces()) { - managedInterfaces.put(fInterface, fInterface.getManagedInterfaces()); validateImportedTypeCollections(model, messageAcceptor, filePath.lastSegment(), cwd, fInterface); } } @@ -169,6 +167,7 @@ public void validateModel(FModel model, ValidationMessageAcceptor messageAccepto } } + // put all imports (with absolute path) of this model to a map private void initImportList(FModel model, String cwd, String filePath) { HashSet importedFiles = new HashSet(); @@ -276,32 +275,33 @@ private HashMap> buildImportList(HashMap 1) + // since Franca 0.8.10 is released, this check is unnecessary + if (!isFrancaVersionGreaterThan(0, 8, 9)) { - for (String s : fastAllInfo.get(fTypeCollection.getName()).get(model.getName())) + if (fastAllInfo.get(typeCollectionName).get(model.getName()).size() > 1) { - if (!s.equals(filePath.toString())) + for (String s : fastAllInfo.get(typeCollectionName).get(model.getName())) { - if (importList.containsKey(s)) - { - acceptError("Imported file " + s + " has interface or typeCollection with the same name and same package!", - fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); - } - else + if (!s.equals(filePath.toString())) { - acceptWarning("Interface or typeCollection in file " + s + " has the same name and same package!", - fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); + if (importList.containsKey(s)) + { + acceptError("Imported file " + s + " has interface or typeCollection with the same name and same package!", + fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); + } + else + { + acceptWarning("Interface or typeCollection in file " + s + " has the same name and same package!", + fTypeCollection, FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); + } } } } @@ -347,19 +347,23 @@ private void validateImportedTypeCollections(FModel model, ValidationMessageAcce { if (entryValue.packageName.startsWith(model.getName() + "." + fTypeCollection.getName())) { - if (importList.get(cwd + "/" + fileName).contains(entry.getKey())) - { - acceptError( - "Imported file's package " + entryValue.packageName + " may not start with package " - + model.getName() + " + " + type + fTypeCollection.getName(), fTypeCollection, - FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); - } - else + HashSet importPaths = importList.get(cwd + "/" + fileName); + if (importPaths != null) { - acceptWarning( - entry.getKey() + ". File's package " + entryValue.packageName + " starts with package " - + model.getName() + " + " + type + fTypeCollection.getName(), fTypeCollection, null, -1, - messageAcceptor); + if (importPaths.contains(entry.getKey())) + { + acceptError( + "Imported file's package " + entryValue.packageName + " may not start with package " + + model.getName() + " + " + type + " " + fTypeCollection.getName(), fTypeCollection, + FrancaPackage.Literals.FMODEL_ELEMENT__NAME, -1, messageAcceptor); + } + else + { + acceptWarning( + "File's package " + entryValue.packageName + " starts with package " + + model.getName() + " + " + type + " " + fTypeCollection.getName(), fTypeCollection, null, -1, + messageAcceptor); + } } } } diff --git a/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/preference/ValidatorSomeIPPreferencesPage.java b/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/preference/ValidatorSomeIPPreferencesPage.java index aadc78e..7680658 100644 --- a/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/preference/ValidatorSomeIPPreferencesPage.java +++ b/org.genivi.commonapi.someip.validator/src/org/genivi/commonapi/someip/validator/preference/ValidatorSomeIPPreferencesPage.java @@ -29,9 +29,9 @@ public void checkState() @Override public void createFieldEditors() { - addField(new BooleanFieldEditor(PreferenceConstantsSomeIP.P_ENABLE_SOMEIP_VALIDATOR, "validator enabled", getFieldEditorParent())); + addField(new BooleanFieldEditor(PreferenceConstantsSomeIP.P_ENABLE_SOMEIP_VALIDATOR, "Enable CommonAPI-Some/IP specific validation of Franca IDL files", getFieldEditorParent())); addField(new BooleanFieldEditor(ENABLED_WORKSPACE_CHECK, - "enable the whole workspace check (Note: Validations takes up to two minutes if enabled)", getFieldEditorParent())); + "Enable whole workspace check", getFieldEditorParent())); } @Override @@ -39,7 +39,6 @@ public void init(IWorkbench workbench) { IPreferenceStore prefStore = CommonApiSomeIPUiPlugin.getValidatorPreferences(); setPreferenceStore(prefStore); - setDescription("Disable or enable the Some/IP validator!"); } } diff --git a/org.genivi.commonapi.someip.verification/CMakeLists.txt b/org.genivi.commonapi.someip.verification/CMakeLists.txt index 280e103..3d20b8c 100644 --- a/org.genivi.commonapi.someip.verification/CMakeLists.txt +++ b/org.genivi.commonapi.someip.verification/CMakeLists.txt @@ -35,6 +35,7 @@ SET(COMMONAPI_CMAKE_INSTALL_PATH "na" CACHE STRING "CommonAPI install path of th SET(COMMONAPI_SOMEIP_CMAKE_INSTALL_PATH "na" CACHE STRING "CommonAPI-SomeIP install path of the cmake files") SET(COMMONAPI_SOMEIP_TOOL_GENERATOR "na" CACHE STRING "CommonAPI-SomeIP-Tools generator install path") SET(COMMONAPI_TEST_FIDL_PATH "na" CACHE STRING "Path to directory with test fidl/fdepl files for code generation") +SET(COMMONAPI_SRC_GEN_DEST "src-gen" CACHE STRING "Path to the destination directory of the generated sources") if("${COMMONAPI_TOOL_GENERATOR}" STREQUAL "") message(FATAL_ERROR "The file path for the commonapi_generator needs to be specified! Use '-DCOMMONAPI_TOOL_GENERATOR' to do so.") @@ -52,6 +53,8 @@ endif() message("Build type: ${CMAKE_BUILD_TYPE}") +message("The path to the destination directory of the generated sources is set to: ${COMMONAPI_SRC_GEN_DEST}") + ############################################################################## # add COMMONAPI install path to cmake find root path @@ -86,7 +89,7 @@ message("COMMONAPI_SOMEIP_INCLUDE_DIRS: ${COMMONAPI_SOMEIP_INCLUDE_DIRS}") file(GLOB FIDL_FILES "${COMMONAPI_TEST_FIDL_PATH}/*.fidl") message("FIDL_FILES: ${FIDL_FILES}") execute_process( - COMMAND ${COMMONAPI_TOOL_GENERATOR} --dest src-gen --skel ${FIDL_FILES} + COMMAND ${COMMONAPI_TOOL_GENERATOR} --dest ${COMMONAPI_SRC_GEN_DEST} --skel ${FIDL_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -144,7 +147,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fidl/conf/ti_threading.fdepl.in file(GLOB FDEPL_FILES "fidl/*.fdepl") message("FDEPL_FILES: ${FDEPL_FILES}") execute_process( - COMMAND ${COMMONAPI_SOMEIP_TOOL_GENERATOR} --dest src-gen ${FDEPL_FILES} + COMMAND ${COMMONAPI_SOMEIP_TOOL_GENERATOR} --dest ${COMMONAPI_SRC_GEN_DEST} ${FDEPL_FILES} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) @@ -174,34 +177,34 @@ message("Compiler options: ${CMAKE_CXX_FLAGS}") include_directories( src - src-gen + ${COMMONAPI_SRC_GEN_DEST} ${COMMONAPI_INCLUDE_DIRS} ${VSOMEIP_INCLUDE_DIRS} ${COMMONAPI_SOMEIP_INCLUDE_DIRS} ) if (MSVC) -set (DERIVED_TYPE_SRC "src-gen/v1/commonapi/datatypes/derived/TestInterface.cpp") -set (POLYMORPHIC_TYPE_SRC "src-gen/v1/commonapi/advanced/polymorph/TestInterface.cpp") +set (DERIVED_TYPE_SRC "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/derived/TestInterface.cpp") +set (POLYMORPHIC_TYPE_SRC "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/polymorph/TestInterface.cpp") endif () # source files file(GLOB GLUE_SRCS - "src-gen/v1/commonapi/communication/*SomeIP*.cpp" - "src-gen/v1/commonapi/advanced/bselective/*SomeIP*.cpp" - "src-gen/v1/commonapi/advanced/managed/*SomeIP*.cpp" - "src-gen/v1/commonapi/advanced/extended/*SomeIP*.cpp" - "src-gen/v1/commonapi/advanced/polymorph/*SomeIP*.cpp" - "src-gen/v1/commonapi/datatypes/primitive/*SomeIP*.cpp" - "src-gen/v1/commonapi/datatypes/advanced/*SomeIP*.cpp" - "src-gen/v1/commonapi/datatypes/combined/*SomeIP*.cpp" - "src-gen/v1/commonapi/datatypes/deployment/*SomeIP*.cpp" - "src-gen/v1/commonapi/datatypes/derived/*SomeIP*.cpp" - "src-gen/v1/commonapi/performance/primitive/*SomeIP*.cpp" - "src-gen/v1/commonapi/performance/complex/*SomeIP*.cpp" - "src-gen/v1/commonapi/runtime/*SomeIP*.cpp" - "src-gen/v1/commonapi/threading/*SomeIP*.cpp" - "src-gen/v1/commonapi/stability/sp/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/communication/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/bselective/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/managed/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/extended/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/advanced/polymorph/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/primitive/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/advanced/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/combined/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/deployment/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/datatypes/derived/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/performance/primitive/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/performance/complex/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/runtime/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/threading/*SomeIP*.cpp" + "${COMMONAPI_SRC_GEN_DEST}/v1/commonapi/stability/sp/*SomeIP*.cpp" ${DERIVED_TYPE_SRC} ${POLYMORPHIC_TYPE_SRC} ) diff --git a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FInterfaceSomeIPDeploymentGenerator.xtend b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FInterfaceSomeIPDeploymentGenerator.xtend index d6f1a5c..3ab2a96 100644 --- a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FInterfaceSomeIPDeploymentGenerator.xtend +++ b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FInterfaceSomeIPDeploymentGenerator.xtend @@ -177,27 +177,62 @@ class FInterfaceSomeIPDeploymentGenerator extends FTypeCollectionSomeIPDeploymen ///////////////////////////////////// // Generate deployment definitions // ///////////////////////////////////// - def protected String generateDeploymentDefinition(FArgument _argument, FMethod _method, FInterface _interface, PropertyAccessor _accessor) { - if (_accessor.hasSpecificDeployment(_argument) || (_argument.array && _accessor.hasDeployment(_argument))) { - var String definition = _argument.getDeploymentType(_interface, true) + " " + _method.name + "_" + _argument.name + "Deployment(" - definition += _argument.getDeploymentParameter(_argument, _accessor) + def protected dispatch String generateDeploymentDefinition(FAttribute _attribute, FInterface _interface, PropertyAccessor _accessor) { + if (_accessor.hasSpecificDeployment(_attribute) || (_attribute.array && _accessor.hasDeployment(_attribute))) { + var String definition = "" + if (_attribute.array && _accessor.hasNonArrayDeployment(_attribute)) { + definition += _attribute.type.getDeploymentType(_interface, true) + " " + _attribute.name + "ElementDeployment(" + definition += getDeploymentParameter(_attribute.type, _attribute, _accessor) + definition += ");\n"; + } + definition += _attribute.getDeploymentType(_interface, true) + " " + _attribute.name + "Deployment(" + if (_attribute.array && _accessor.hasNonArrayDeployment(_attribute)) { + definition += "&" + _attribute.name + "ElementDeployment, " + definition += getArrayDeploymentParameter(_attribute.type, _attribute, _accessor) + } else { + definition += _attribute.getDeploymentParameter(_attribute, _accessor) + } definition += ");" return definition } + return "" } - def protected dispatch String generateDeploymentDefinition(FAttribute _attribute, FInterface _interface, PropertyAccessor _accessor) { - if (_accessor.hasSpecificDeployment(_attribute) || (_attribute.array && _accessor.hasDeployment(_attribute))) { - var String definition = _attribute.getDeploymentType(_interface, true) + " " + _attribute.name + "Deployment(" - definition += _attribute.getDeploymentParameter(_attribute, _accessor) + + def protected String generateDeploymentDefinition(FArgument _argument, FMethod _method, FInterface _interface, PropertyAccessor _accessor) { + if (_accessor.hasSpecificDeployment(_argument) || (_argument.array && _accessor.hasDeployment(_argument))) { + var String definition = "" + if (_argument.array && _accessor.hasNonArrayDeployment(_argument)) { + definition += _argument.type.getDeploymentType(_interface, true) + " " + _method.name + "_" + _argument.name + "ElementDeployment(" + definition += getDeploymentParameter(_argument.type, _argument, _accessor) + definition += ");\n"; + } + definition += _argument.getDeploymentType(_interface, true) + " " + _method.name + "_" + _argument.name + "Deployment(" + if (_argument.array && _accessor.hasNonArrayDeployment(_argument)) { + definition += "&" + _method.name + "_" + _argument.name + "ElementDeployment, " + definition += getArrayDeploymentParameter(_argument.type, _argument, _accessor) + } else { + definition += _argument.getDeploymentParameter(_argument, _accessor) + } definition += ");" return definition } - return "" } + def protected String generateDeploymentDefinition(FArgument _argument, FBroadcast _broadcast, FInterface _interface, PropertyAccessor _accessor) { if (_accessor.hasSpecificDeployment(_argument) || (_argument.array && _accessor.hasDeployment(_argument))) { - var String definition = _argument.getDeploymentType(_interface, true) + " " + _broadcast.name + "_" + _argument.name + "Deployment(" - definition += _argument.getDeploymentParameter(_argument, _accessor) + var String definition = "" + if (_argument.array && _accessor.hasNonArrayDeployment(_argument)) { + definition += _argument.type.getDeploymentType(_interface, true) + " " + _broadcast.name + "_" + _argument.name + "ElementDeployment(" + definition += getDeploymentParameter(_argument.type, _argument, _accessor) + definition += ");\n"; + } + definition += _argument.getDeploymentType(_interface, true) + " " + _broadcast.name + "_" + _argument.name + "Deployment(" + if (_argument.array && _accessor.hasNonArrayDeployment(_argument)) { + definition += "&" + _broadcast.name + "_" + _argument.name + "ElementDeployment, " + definition += getArrayDeploymentParameter(_argument.type, _argument, _accessor) + } else { + definition += _argument.getDeploymentParameter(_argument, _accessor) + } definition += ");" return definition } diff --git a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FTypeCollectionSomeIPDeploymentGenerator.xtend b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FTypeCollectionSomeIPDeploymentGenerator.xtend index e860496..2dfe568 100644 --- a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FTypeCollectionSomeIPDeploymentGenerator.xtend +++ b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FTypeCollectionSomeIPDeploymentGenerator.xtend @@ -376,12 +376,18 @@ class FTypeCollectionSomeIPDeploymentGenerator { def protected dispatch String generateDeploymentDefinition(FField _field, FTypeCollection _tc, PropertyAccessor _accessor) { if (_accessor.hasSpecificDeployment(_field) || (_field.array && _accessor.hasDeployment(_field))) { - var String definition = _field.getDeploymentType(_tc, true) + " " + _field.getRelativeName() + "Deployment(" - if (_field.array) { - definition += getArrayElementTypeDeploymentParameter(_field.type, _field, _accessor) + ", " + var String definition = ""; + if (_field.array && _accessor.hasNonArrayDeployment(_field)) { + definition += _field.type.getDeploymentType(_tc, false) + " " + _field.getRelativeName() + "ElementDeployment(" + definition += getDeploymentParameter(_field.type, _field, _accessor) + definition += ");\n"; + } + definition += _field.getDeploymentType(_tc, true) + " " + _field.getRelativeName() + "Deployment(" + if (_field.array && _accessor.hasNonArrayDeployment(_field)) { + definition += "&" + _field.getRelativeName() + "ElementDeployment, " definition += getArrayDeploymentParameter(_field.type, _field, _accessor) } else { - definition += getDeploymentParameter(_field.type, _field, _accessor) + definition += getDeploymentParameter(_field, _field, _accessor) } definition += ");\n" return definition diff --git a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FrancaSomeIPDeploymentAccessorHelper.xtend b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FrancaSomeIPDeploymentAccessorHelper.xtend index 03bcd8c..fb890ba 100644 --- a/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FrancaSomeIPDeploymentAccessorHelper.xtend +++ b/org.genivi.commonapi.someip/src/org/genivi/commonapi/someip/generator/FrancaSomeIPDeploymentAccessorHelper.xtend @@ -1,5 +1,4 @@ -// Copyright (C) 2014, 2015 BMW Group -// Author: Lutz Bichler (lutz.bichler@bmw.de) +// Copyright (C) 2014-2017 BMW Group // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this // file, You can obtain one at http://mozilla.org/MPL/2.0/. @@ -380,7 +379,7 @@ class FrancaSomeIPDeploymentAccessorHelper { } if (_obj instanceof FField) { - var Integer lengthWidth = _accessor.getSomeIpStructLengthWidth(_obj) + var Integer lengthWidth = _accessor.getSomeIpStructStructLengthWidth(_obj) if (lengthWidth == null) lengthWidth = _accessor.getSomeIpUnionStructLengthWidth(_obj) return lengthWidth @@ -1241,4 +1240,98 @@ class FrancaSomeIPDeploymentAccessorHelper { } return false } + + def boolean hasNonArrayDeployment(PropertyAccessor _accessor, + FTypedElement _attribute) { + if (_attribute.type.derived != null + && _attribute.type.derived instanceof FMapType) { + if (hasSomeIpMapMinLength(_accessor, _attribute)) { + return true + } + if (hasSomeIpMapMaxLength (_accessor, _attribute)) { + return true + } + if (hasSomeIpMapLengthWidth (_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.predefined != null + && _attribute.type.predefined == FBasicTypeId.BYTE_BUFFER) { + if (hasSomeIpByteBufferMinLength(_accessor, _attribute)) { + return true + } + if (hasSomeIpByteBufferMaxLength(_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.predefined != null + && _attribute.type.predefined == FBasicTypeId.STRING) { + if (hasSomeIpStringLength (_accessor, _attribute)) { + return true + } + if (hasSomeIpStringLengthWidth (_accessor, _attribute)) { + return true + } + if (hasSomeIpStringEncoding (_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.derived != null + && _attribute.type.derived instanceof FStructType) { + if (hasSomeIpStructLengthWidth (_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.derived != null + && _attribute.type.derived instanceof FUnionType) { + if (hasSomeIpUnionLengthWidth (_accessor, _attribute)) { + return true + } + if (hasSomeIpUnionTypeWidth (_accessor, _attribute)) { + return true + } + if (hasSomeIpUnionDefaultOrder (_accessor, _attribute)) { + return true + } + if (hasSomeIpUnionMaxLength (_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.derived != null + && _attribute.type.derived instanceof FEnumerationType) { + if (hasSomeIpEnumWidth(_accessor, _attribute)) { + return true + } + if (hasSomeIpEnumBitWidth(_accessor, _attribute)) { + return true + } + if (hasSomeIpEnumInvalidValue (_accessor, _attribute)) { + return true + } + } + + if (_attribute.type.predefined != null + && (_attribute.type.predefined == FBasicTypeId.INT8 + || _attribute.type.predefined == FBasicTypeId.INT16 + || _attribute.type.predefined == FBasicTypeId.INT32 + || _attribute.type.predefined == FBasicTypeId.INT64 + || _attribute.type.predefined == FBasicTypeId.UINT8 + || _attribute.type.predefined == FBasicTypeId.UINT16 + || _attribute.type.predefined == FBasicTypeId.UINT32 + || _attribute.type.predefined == FBasicTypeId.UINT64)) { + if (hasSomeIpIntegerBitWidth (_accessor, _attribute)) { + return true + } + if (hasSomeIpIntegerInvalidValue (_accessor, _attribute)) { + return true + } + } + + return false + } }