mirror of
https://github.com/eclipse-openvehicle-api/openvehicle-api.git
synced 2026-04-18 10:38:16 +00:00
Update sdv_packager (#6)
This commit is contained in:
@@ -1,18 +1,22 @@
|
||||
/**
|
||||
* @file app.idl
|
||||
* @brief This file provides the core interface definitions SDV framework administration.
|
||||
* @version 0.1
|
||||
* @date 2024.04.11
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023-2025
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
#include "toml.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
/**
|
||||
* @file can.idl
|
||||
* @author Erik Verhoeven FRD DISS2 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file provides the CAN abstraction interfaces
|
||||
* @version 1.0
|
||||
* @date 2024-02-07
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2024
|
||||
*
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* @file com.idl
|
||||
* @author Erik Verhoeven FRD DISDS1 (mailto:erik.verhoeven@zf.com) & Steffen Altmeier FRD DISS21 (mailto:steffen.altmeier@zf.com)
|
||||
* @brief This file includes all the interfaces used by the communication control service
|
||||
* @version 1.0
|
||||
* @date 2024-08-12
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2024
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
#include "core_ps.idl"
|
||||
|
||||
@@ -1,24 +1,27 @@
|
||||
/**
|
||||
* @file app.idl
|
||||
* @brief This file provides the core interface definitions SDV framework administration.
|
||||
* @version 0.1
|
||||
* @date 2024.04.11
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023-2025
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
#verbatim_begin
|
||||
#include "../support/string.h"
|
||||
#verbatim_end
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
#verbatim_begin
|
||||
#include "../support/string.h"
|
||||
#verbatim_end
|
||||
|
||||
|
||||
/**
|
||||
* @brief Failed to open a file.
|
||||
*/
|
||||
@@ -153,13 +156,27 @@ module sdv
|
||||
/**
|
||||
* @brief Save a configuration file pointed to by the provided file path. All components are saved that were added after
|
||||
* the last baseline with the configuration specific settings.
|
||||
* @attention Configuration changes can only occur when the system is in configuration mode.
|
||||
* @remarks The function will only save when the configuration has changed.
|
||||
* @param[in] ssConfigPath Path to the file containing the configuration (TOML). The path can be an absolute as well as a
|
||||
* relative path. In case a relative path is provided, the configuration is stored relative to the executable directory.
|
||||
* @return Returns 'true' on success; 'false' otherwise.
|
||||
* @return Returns 'true' on success (or no changes detected); 'false' otherwise.
|
||||
*/
|
||||
boolean SaveConfig(in u8string ssConfigPath) const;
|
||||
|
||||
/**
|
||||
* @brief Generate the configuration TOML string.
|
||||
* @return The generated configuration string.
|
||||
*/
|
||||
u8string GenerateConfigString() const;
|
||||
|
||||
/**
|
||||
* @brief Close the current configuration.
|
||||
* @details This will close und unload the components and modules from the current configuration as well as dependent
|
||||
* components that builds on top of the components being closed. Components that the current configuration depends on
|
||||
* are not closed.
|
||||
*/
|
||||
void CloseConfig();
|
||||
|
||||
/**
|
||||
* @brief Add a search path to a folder where a config file can be found.
|
||||
* @param[in] ssDir Relative or absolute path to an existing folder.
|
||||
@@ -174,7 +191,7 @@ module sdv
|
||||
*/
|
||||
void ResetConfigBaseline();
|
||||
};
|
||||
}; // module core
|
||||
}; // module core
|
||||
|
||||
/**
|
||||
* @brief Installation module.
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
/**
|
||||
* @file core.idl
|
||||
* @brief This file provides the core interface definitions of the core SDV framework.
|
||||
* @version 0.1
|
||||
* @date 2023.04.26
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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
|
||||
*
|
||||
* This file provides the core interface definitions of the core SDV framework.
|
||||
*
|
||||
* Contributors:
|
||||
* Erik Verhoeven - initial API and implementation
|
||||
********************************************************************************/
|
||||
|
||||
#include "core_types.idl"
|
||||
|
||||
@@ -25,8 +31,8 @@
|
||||
#verbatim_end
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
@@ -61,14 +67,20 @@ module sdv
|
||||
*/
|
||||
enum EObjectType : uint32
|
||||
{
|
||||
SystemObject = 0, ///< System object
|
||||
Device = 10, ///< Abstract device
|
||||
BasicService = 20, ///< Basic service
|
||||
ComplexService = 21, ///< Complex service
|
||||
Application = 30, ///< Application
|
||||
Proxy = 100, ///< Proxy object
|
||||
Stub = 101, ///< Stub object
|
||||
Utility = 1000, ///< Utility object
|
||||
undefined = 0, ///< Not defined
|
||||
system_object = 1, ///< System object
|
||||
device = 10, ///< Device category 10..19
|
||||
platform_abstraction = 11, ///< Platform abstraction object
|
||||
vehicle_bus = 12, ///< Vehicle bus object
|
||||
basic_service = 20, ///< Basic service category 20..29
|
||||
sensor = 21, ///< Sensor object
|
||||
actuator = 22, ///< Actuator object
|
||||
complex_service = 30, ///< Complex service category 30..39
|
||||
vehicle_function = 31, ///< Vehicle function
|
||||
application = 50, ///< Application
|
||||
proxy = 100, ///< Proxy object
|
||||
stub = 101, ///< Stub object
|
||||
utility = 1000, ///< Utility object
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -85,9 +97,10 @@ module sdv
|
||||
struct SClassInfo
|
||||
{
|
||||
u8string ssModulePath; ///< Path to the module that contains the class.
|
||||
u8string ssClassName; ///< String representing the class name.
|
||||
u8string ssName; ///< String representing the class name.
|
||||
sequence<u8string> seqClassAliases; ///< Sequence with class name aliases.
|
||||
u8string ssDefaultObjectName; ///< The default object name.
|
||||
u8string ssDefaultConfig; ///< The configuration TOML. Currently only "Parameters" table is supported.
|
||||
EObjectType eType; ///< Type of object.
|
||||
uint32 uiFlags; ///< Zero or more object flags from EObjectFlags.
|
||||
sequence<u8string> seqDependencies; ///< Sequence with object class names this object is dependent on.
|
||||
@@ -98,6 +111,19 @@ module sdv
|
||||
*/
|
||||
interface IObjectFactory
|
||||
{
|
||||
/**
|
||||
* @brief The object class names implemented in the object.
|
||||
* @return Sequence with object class names string.
|
||||
*/
|
||||
sequence<u8string> GetClassNames() const;
|
||||
|
||||
/**
|
||||
* @brief Get the class information.
|
||||
* @param[in] ssClassName The name of the class object to get the class information for.
|
||||
* @return Returns the class information struct.
|
||||
*/
|
||||
SClassInfo GetClassInfo(in u8string ssClassName) const;
|
||||
|
||||
/**
|
||||
* @brief Create or get the object using the name from the object class info.
|
||||
* @attention The objects lifetime is ended by a call to the DestroyObject function or the unloading of the module.
|
||||
@@ -119,9 +145,9 @@ module sdv
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Object status enumeration
|
||||
* @brief Object state enumeration
|
||||
*/
|
||||
enum EObjectStatus : uint32
|
||||
enum EObjectState : uint32
|
||||
{
|
||||
initialization_pending = 0, ///< constructor called, but no call to initialize yet
|
||||
initializing = 10, ///< Initialize was called and is being executed.
|
||||
@@ -158,10 +184,10 @@ module sdv
|
||||
void Initialize(in u8string ssObjectConfig);
|
||||
|
||||
/**
|
||||
* @brief Get the current status of the object.
|
||||
* @return Return the current status of the object.
|
||||
* @brief Get the current state of the object.
|
||||
* @return Return the current state of the object.
|
||||
*/
|
||||
EObjectStatus GetStatus() const;
|
||||
EObjectState GetObjectState() const;
|
||||
|
||||
/**
|
||||
* @brief Set the component operation mode.
|
||||
@@ -169,12 +195,18 @@ module sdv
|
||||
*/
|
||||
void SetOperationMode(in EOperationMode eMode);
|
||||
|
||||
/**
|
||||
* @brief Get the object configuration for persistence.
|
||||
* @return The object configuration as TOML string.
|
||||
*/
|
||||
u8string GetObjectConfig() const;
|
||||
|
||||
/**
|
||||
* @brief Shutdown called before the object is destroyed.
|
||||
* @attention Implement calls to other SDV objects here as this is no longer considered safe during the destructor of the object!
|
||||
* After a call to shutdown any threads/callbacks/etc that could call other SDV objects need to have been stopped.
|
||||
* The SDV object itself is to remain in a state where it can respond to calls to its interfaces as other objects may still call it during the shutdown sequence!
|
||||
* Any subsequent call to GetStatus should return EObjectStatus::destruction_pending
|
||||
* Any subsequent call to GetObjectState should return EObjectState::destruction_pending
|
||||
*/
|
||||
void Shutdown();
|
||||
};
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
/**
|
||||
* @file core_idl.idl
|
||||
* @brief This file provides all interface definitions for generator of the IDL compiler as part of the core SDV framework.
|
||||
* @version 0.1
|
||||
* @date 2023.06.29
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2022-2025
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
#include "mem.idl"
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
|
||||
@@ -1,16 +1,20 @@
|
||||
/**
|
||||
* @file core_ps.idl
|
||||
* @brief This file provides the marshalling interface definitions of the core SDV framework.
|
||||
* @version 0.1
|
||||
* @date 2023.05.10
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
#include "process.idl"
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
/********************************************************************************
|
||||
* 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
|
||||
********************************************************************************/
|
||||
|
||||
/**
|
||||
* @file core_types.idl
|
||||
* @brief This file provides all data types for the core SDV framework.
|
||||
* @version 0.1
|
||||
* @date 2023.05.08
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -56,8 +64,8 @@ const uint32 SDVFrameworkSubbuildVersion = 100;
|
||||
#verbatim_end
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
/**
|
||||
*
|
||||
* @file dispatch.idl
|
||||
* @brief This file provides interfaces related to the data dispatch service.
|
||||
* @version 1.0
|
||||
* @date 2024.01.12
|
||||
* @author Erik Verhoeven
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2024
|
||||
*
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,18 +1,21 @@
|
||||
/**
|
||||
* @file hw_ident.idl
|
||||
* @author Erik Verhoeven DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for hardware identification.
|
||||
* @version 1.0
|
||||
* @date 2024-05-09
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* @file ipc.idl
|
||||
* @author Erik Verhoeven DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for interpprocess communication.
|
||||
* @version 1.0
|
||||
* @date 2024-05-09
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* @file log.idl
|
||||
* @author Erik Verhoeven DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for logging information.
|
||||
* @version 1.0
|
||||
* @date 2024-05-09
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
#include "process.idl"
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
/**
|
||||
* @file mem.idl
|
||||
* @brief This file provides the memory management interface definitions of the core SDV framework.
|
||||
* @version 0.1
|
||||
* @date 2023.05.22
|
||||
* @author erik.verhoeven@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2023
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
|
||||
@@ -1,19 +1,21 @@
|
||||
/**
|
||||
* @file module.idl
|
||||
* @author Erik Verhoeven FRD DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for module management
|
||||
* @version 1.0
|
||||
* @date 2024-05-02
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
|
||||
177
export/interfaces/param.idl
Normal file
177
export/interfaces/param.idl
Normal file
@@ -0,0 +1,177 @@
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 Contributors to the Eclipse Foundation
|
||||
*
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
* @brief Parameter bitmask flags.
|
||||
*/
|
||||
enum EParamFlags : uint32
|
||||
{
|
||||
mask = 0xff, ///< Flags for the setting the parameter attributes
|
||||
read_write = 0x00, ///< Read/write access to the parameter.
|
||||
read_only = 0x01, ///< The parameter is read only.
|
||||
temporary = 0x20, ///< The parameter is marked as a temporary parameter.
|
||||
|
||||
state_mask = 0xff00, ///< Flags for the parameter states
|
||||
dirty = 0x0100, ///< Parameter has changed.
|
||||
locked = 0x0400, ///< When set, the parameter is not writable.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Parameter type.
|
||||
*/
|
||||
enum EParamType
|
||||
{
|
||||
boolean_param, ///< The parameter is a boolean.
|
||||
number_param, ///< The parameter is a number (integral or floating point).
|
||||
string_param, ///< The parameter is a string.
|
||||
enum_param, ///< The parameter is an enumeration value.
|
||||
bitmask_param ///< The parameter is a bitmask value.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Specific number information.
|
||||
*/
|
||||
struct SNumberInfo
|
||||
{
|
||||
any anyLowerLimit; ///< Optional lower limit value.
|
||||
boolean bIncludeLowerLinit; ///< When set, low <= val, otherwise low < val.
|
||||
any anyUpperLimit; ///< Optional upper limit value.
|
||||
boolean bIncludeUpperLimit; ///< When set, val >= upper, otherwise val > upper.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Specific string information.
|
||||
*/
|
||||
struct SStringInfo
|
||||
{
|
||||
u8string ssPattern; ///< Regular expression pattern describing the allowed pattern.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Specific label information for enumerations and bitmasks.
|
||||
*/
|
||||
struct SLabelInfo
|
||||
{
|
||||
/**
|
||||
* @brief Each label is described by a value and label text.
|
||||
*/
|
||||
struct SLabel
|
||||
{
|
||||
any anyValue; ///< Label value (must be an integral number)
|
||||
u8string ssLabel; ///< Label text
|
||||
};
|
||||
sequence<SLabel> seqLabels; ///< Sequence of element labels
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Structure to represent parameter information.
|
||||
*/
|
||||
struct SParamInfo
|
||||
{
|
||||
EParamType eType; ///< Parameter type
|
||||
uint32 uiFlags; ///< Parameter flags containing one or more values of the EParamFlags enumeration.
|
||||
u8string ssName; ///< The name of the parameter.
|
||||
u8string ssGroup; ///< Optional group name for this parameter. Can contain sub-groups separated by a dot.
|
||||
u8string ssUnit; ///< Optional parameter unit.
|
||||
u8string ssDescription; ///< Optional parameter description.
|
||||
any anyDefaultVal; ///< Default value
|
||||
|
||||
/// Union holding extended parameter information.
|
||||
union switch (eType)
|
||||
{
|
||||
case EParamType::number_param:
|
||||
SNumberInfo sNumberInfo; ///< Additional information for number types
|
||||
case EParamType::string_param:
|
||||
SStringInfo sStringInfo; ///< Additional information for string types.
|
||||
case EParamType::enum_param:
|
||||
SLabelInfo sEnumInfo; ///< Additional information for enumeration types.
|
||||
case EParamType::bitmask_param:
|
||||
SLabelInfo sBitmaskInfo; ///< Additional information for bitmask types.
|
||||
} uExtInfo; ///< Extended parameter information.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Interface to access parameters.
|
||||
*/
|
||||
interface IParameters
|
||||
{
|
||||
/**
|
||||
* @brief Return a sequence with parameter paths. Each path is unique and can be used to get and set the parameter value.
|
||||
* @return Sequence containing parameter paths. Parameter paths are composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
*/
|
||||
sequence<u8string> GetParamPaths() const;
|
||||
|
||||
/**
|
||||
* @brief Returns the parameter value.
|
||||
* @param[in] ssPath Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
* @return Returns the parameter value. Returns an 'empty' parameter value when not successful or the parameter is not set.
|
||||
*/
|
||||
any GetParam(in u8string ssPath) const;
|
||||
|
||||
/**
|
||||
* @brief Set the parameter value.
|
||||
* @param[in] ssPath Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
* @param[in] anyValue Reference to the parameter value to set.
|
||||
* @return Returns 'true' on success or 'false' when parameter could not be set (e.g. the parameter is read-only) or the
|
||||
* index is larger than the amount of parameters being available.
|
||||
*/
|
||||
boolean SetParam(in u8string ssPath, in any anyValue);
|
||||
|
||||
/**
|
||||
* @brief Get parameter information.
|
||||
* @param[in] ssPath Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
* @return Return the parameter information for the requested parameter or an empty structure when no parameter information
|
||||
* is available or the parameter is not available.
|
||||
*/
|
||||
SParamInfo GetParamInfo(in u8string ssPath) const;
|
||||
|
||||
/**
|
||||
* @brief Is the parameter dirty (was it changed)? Checks the parameter dirty flag.
|
||||
* @param[in] ssPath Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
* @return Returns whether the parameter was changed either by an explicit call to the SetParam function or internally by
|
||||
* the
|
||||
* object itself.
|
||||
*/
|
||||
boolean IsParamDirty(in u8string ssPath) const;
|
||||
|
||||
/**
|
||||
* @brief Reset the dirty flag for the parameter.
|
||||
* @param[in] ssPath Path of the parameter. The parameter path is composed from group/sub-groups and the parameter name,
|
||||
* separated by a dot.
|
||||
*/
|
||||
void ResetParamDirtyFlag(in u8string ssPath);
|
||||
|
||||
/**
|
||||
* @brief Is there at least one parameter with a dirty flag?
|
||||
* @return Returns whether at least one parameter has its dirty flag enabled.
|
||||
*/
|
||||
boolean IsParamMapDirty() const;
|
||||
|
||||
/**
|
||||
* @brief Reset the dirty flag for all parameters.
|
||||
*/
|
||||
void ResetParamMapDirtyFlags();
|
||||
};
|
||||
}; // sdv
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* @file process.idl
|
||||
* @author Erik Verhoeven DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for process creation.
|
||||
* @version 1.0
|
||||
* @date 2024-05-09
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
|
||||
|
||||
@@ -1,19 +1,22 @@
|
||||
/**
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @file repository.idl
|
||||
* @brief This file provides interfaces related to the repository service
|
||||
* @version 0.1
|
||||
* @date 2022.11.21
|
||||
* @author steffen.altmeier@zf.com
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2022
|
||||
* 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 "core.idl"
|
||||
#include "module.idl"
|
||||
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
/**
|
||||
* @brief Software Defined Vehicle framework.
|
||||
*/
|
||||
module sdv
|
||||
{
|
||||
/**
|
||||
@@ -110,6 +113,7 @@ module sdv
|
||||
|
||||
/**
|
||||
* @brief Interface used to control object creation and destruction.
|
||||
* @remarks This interface is exposed by the repository on for standalone, essential and isolated applications.
|
||||
*/
|
||||
interface IRepositoryControl
|
||||
{
|
||||
@@ -128,8 +132,7 @@ module sdv
|
||||
* @param[in] ssObjectName Name of the object, required to be unique. For standalone and essential applications, the
|
||||
* name string can be empty, in which case the object might either provide a name proposal or the name is the same as
|
||||
* the class name. Use the returned object ID to request the name of the object.
|
||||
* @param[in] ssObjectConfig Optional configuration handed over to the object upon creation via IObjectControl. Only
|
||||
* valid for standalone, essential and isolated applications.
|
||||
* @param[in] ssObjectConfig Optional configuration handed over to the object upon creation via IObjectControl.
|
||||
* @return Returns the object ID when the object creation was successful or 0 when not. On success the object is
|
||||
* available through the IObjectAccess interface. If the object already exists (class and object names are identical),
|
||||
* the object ID of the existing object is returned.
|
||||
|
||||
@@ -1,12 +1,15 @@
|
||||
/**
|
||||
* @file timer.idl
|
||||
* @author Erik Verhoeven DISDS1 (mailto:erik.verhoeven@zf.com)
|
||||
* @brief This file includes all the interfaces used for timer creation.
|
||||
* @version 1.0
|
||||
* @date 2024-05-09
|
||||
/********************************************************************************
|
||||
* Copyright (c) 2025-2026 ZF Friedrichshafen AG
|
||||
*
|
||||
* @copyright Copyright ZF Friedrichshafen AG (c) 2023-2025
|
||||
*/
|
||||
* 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 "core.idl"
|
||||
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
/**
|
||||
*
|
||||
* @file dispatch.idl
|
||||
* @brief This file provides interfaces related to the data dispatch service.
|
||||
* @version 1.0
|
||||
* @date 2024.01.12
|
||||
* @author Erik Verhoeven
|
||||
* @copyright Copyright ZF Friedrichshaven AG (c) 2024
|
||||
*
|
||||
*/
|
||||
/********************************************************************************
|
||||
* 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 "core.idl"
|
||||
|
||||
/**
|
||||
@@ -102,13 +105,9 @@ module sdv
|
||||
u8string GetTOML() const;
|
||||
|
||||
/**
|
||||
* @brief Comment access flags.
|
||||
* @details The comment access flags contain the comment code snippet index (0..15) as well as flags to receive the
|
||||
* comments in interpreted or raw form. For comment code snippets are defined for all nodes, the comments before and
|
||||
* after the node not related to the node and the comments before and after the node related to the node. Comment or
|
||||
* whitespace in between the node tokens are part of the other 11 indices (each node interprets this differently).
|
||||
* @brief Node comment type.
|
||||
*/
|
||||
enum ECommentFlags
|
||||
enum ECommentType
|
||||
{
|
||||
comment_before = 0, ///< The comment before the node. This will insert a newline and the comment
|
||||
///< text preceded by the '#' character.
|
||||
@@ -118,169 +117,47 @@ module sdv
|
||||
///< node and is separated by an extra newline.
|
||||
out_of_scope_comment_behind = 3, ///< An independent comment behind the node. This comment is not part of the
|
||||
///< node and is separated by an extra newline.
|
||||
comment_index_mask = 15, ///< Comment type mask to be used ot filter the comment type.
|
||||
raw_comment = 8, ///< Store the comment exactly as provided (whitespace and comments).
|
||||
replace_whitespace = 16, ///< When set, the comment will replace the current whitespace as well.
|
||||
///< Used with SetComment function. Automatically enabled for raw comments.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Set or replace a comment for the node.
|
||||
* @remarks This function can also be used to insert whitespace (with or without comments) when used in raw mode.
|
||||
* Set the comment text for the node. If a comment is proided as text (normal behavior), the comment text will be
|
||||
* formatted automatically when generating the TOML text. If the comment is provided as raw comment, the text should
|
||||
* contain all whitespace and the comment '#' character before the comment text.
|
||||
* Comments inserted before the enode will be inserted on the line before the node uness the comment is provided in raw
|
||||
* format and is ended with a newline and optionally whitespace. Comment inserted behind the node will be inserted on
|
||||
* @details Set the comment text for the node. If a comment is provided as text (normal behavior), the comment text will
|
||||
* be formatted automatically when generating the TOML text. If the comment text should not contain the comment
|
||||
* character '#' before the comment text.
|
||||
* Comments inserted before the node will be inserted on the line before the node unless the comment is provided in raw
|
||||
* format and is ended with a line-break and optionally whitespace. Comment inserted behind the node will be inserted on
|
||||
* the same line as the node.
|
||||
* Comments provided as text is automatically wrapped to 80 characters if possible. Newlines in the text will cause a
|
||||
* new comment line to start.
|
||||
* @param[in] ssComment String containing the comment text or the raw comment string to set.
|
||||
* @param[in] uiFlags One or more ECommentFlags flags influencing the behavior of the comment.
|
||||
* Comments provided as text is automatically wrapped to 132 characters if possible. Line-breaks in the text will cause
|
||||
* a new comment line to start.
|
||||
* @param[in] eType The comment type to set the comment text for.
|
||||
* @param[in] ssComment String containing the comment text to set.
|
||||
*/
|
||||
void SetComment(in u8string ssComment, in uint32 uiFlags);
|
||||
void SetComment(in ECommentType eType, in u8string ssComment);
|
||||
|
||||
/**
|
||||
* Get the current comment for the node.
|
||||
* @remarks To receive the whitespace formatting the node, use this function in raw mode.
|
||||
* @param[in] uiFlags One or more ECommentFlags flags identifying the string format of the comment to return.
|
||||
* @param[in] eType The comment type to get the comment text of.
|
||||
* @return String with the comment text or an empty string if no comment is available.
|
||||
*/
|
||||
u8string GetComment(in uint32 uiFlags);
|
||||
u8string GetComment(in ECommentType eType);
|
||||
|
||||
/**
|
||||
* @brief Format the node automatically. This will remove the whitespace between the elements within the node. Comments
|
||||
* will not be changed.
|
||||
*/
|
||||
void AutomaticFormat();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Interface allowing access to table and array nodes.
|
||||
*/
|
||||
interface INodeCollection
|
||||
{
|
||||
/**
|
||||
* @brief Returns the amount of nodes.
|
||||
* @return The amount of nodes.
|
||||
*/
|
||||
uint32 GetCount() const;
|
||||
|
||||
/**
|
||||
* @brief Get the node.
|
||||
* @param[in] uiIndex Index of the node to get.
|
||||
* @return Interface to the node object.
|
||||
* @brief Is the node inline?
|
||||
* @return Returns whether the node is defined as inline node.
|
||||
*/
|
||||
IInterfaceAccess GetNode(in uint32 uiIndex) const;
|
||||
boolean IsInline() const;
|
||||
|
||||
/**
|
||||
* @brief Searches a node by its key in the parse tree
|
||||
* @details Elements of tables can be accessed and traversed by using '.' to separated the parent name from child
|
||||
* name. E.g. 'parent.child' would access the 'child' element of the 'parent' table. Elements of arrays can be
|
||||
* accessed and traversed by using the index number in brackets. E.g. 'array[3]' would access the fourth element of
|
||||
* the array 'array'. These access conventions can also be chained like 'table.array[2][1].subtable.integerElement'.
|
||||
* @attention Array indexing starts with 0!
|
||||
* @param[in] ssPath The path of the Node to searched for.
|
||||
* @return Returns an interface the requested node if available.
|
||||
* @brief Is the node defined as standard node?
|
||||
* @return Returns whether the node is defined as standard node.
|
||||
*/
|
||||
IInterfaceAccess GetNodeDirect(in u8string ssPath) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Extend the collection node with values, arrays and tables.
|
||||
*/
|
||||
interface INodeCollectionInsert
|
||||
{
|
||||
/**
|
||||
* @brief Insert a value into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Value nodes cannot be inserted behind external
|
||||
* tables and table arrays. If the index is referencing a position behind an external table or a table array, the index
|
||||
* is automatically corrected.
|
||||
* @param[in] ssName Name of the node to insert. Will be ignored for an array collection. The name must adhere to the
|
||||
* key names defined by the TOML specification. Defining the key multiple times is not allowed. Quotation of key names
|
||||
* is done automatically; the parser decides itself whether the key is bare-key, a literal key or a quoted key.
|
||||
* @param[in] anyValue The value of the node, being either an integer, floating point number, boolean value or a string.
|
||||
* Conversion is automatically done to int64, double float, bool or u8string.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertValue(in uint32 uiIndex, in u8string ssName, in any anyValue);
|
||||
|
||||
/**
|
||||
* @brief Insert an array into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Array nodes cannot be inserted behind external
|
||||
* tables and table arrays. If the index is referencing a position behind an external table or a table array, the index
|
||||
* is automatically corrected.
|
||||
* @param[in] ssName Name of the array node to insert. Will be ignored if the current node is also an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertArray(in uint32 uiIndex, in u8string ssName);
|
||||
|
||||
/**
|
||||
* @brief Insert a table into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Table nodes cannot be inserted before value nodes
|
||||
* or arrays. If the index is referencing a position before a value node or an array, the index is automatically
|
||||
* corrected.
|
||||
* @param[in] ssKeyName Name of the table node to insert. Will be ignored if the current node is an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertTable(in uint32 uiIndex, in u8string ssKeyName);
|
||||
|
||||
/**
|
||||
* @brief Insert a table array into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Table array nodes cannot be inserted before value
|
||||
* nodes or arrays. If the index is referencing a position before a value node or an array, the index is automatically
|
||||
* corrected.
|
||||
* @param[in] ssName Name of the array node to insert. Will be ignored if the current node is also an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertTableArray(in uint32 uiIndex, in u8string ssName);
|
||||
|
||||
/**
|
||||
* @brief The result of the TOML string to insert.
|
||||
*/
|
||||
enum EInsertResult : uint32
|
||||
{
|
||||
invalid_TOML, ///< The TOML string was invalid or didn't fit the collection node it was to be inserted.
|
||||
insert_partly_success, ///< Part, but not all nodes could be inserted (duplicate nodes are not inserted).
|
||||
insert_success, ///< All nodes could be inserted or the TOML didn't contain any nodes.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Insert a TOML string as a child of the current collection node. If the collection is a table, the TOML string
|
||||
* should contain values and inline/external/array-table nodes with names. If the collection is an array, the TOML
|
||||
* string should contain and inline table nodes without names.
|
||||
* @param[in] ssTOML The TOML string to insert.
|
||||
* @param[in] bRollbackOnPartly If only part of the nodes could be inserted, no node will be inserted.
|
||||
* @return The result of the insertion.
|
||||
*/
|
||||
EInsertResult InsertTOML(in u8string ssTOML, in boolean bRollbackOnPartly);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Remove the current node.
|
||||
* @remarks The root node cannot be deleted.
|
||||
*/
|
||||
interface INodeDelete
|
||||
{
|
||||
/**
|
||||
* @brief Delete the current node.
|
||||
* @attention A successful deletion will cause all interfaces to the current node to become inoperable.
|
||||
* @return Returns whether the deletion was successful.
|
||||
*/
|
||||
boolean DeleteNode();
|
||||
boolean IsStandard() const;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -322,6 +199,176 @@ module sdv
|
||||
* @return Returns whether the move was successful.
|
||||
*/
|
||||
boolean MoveDown();
|
||||
|
||||
/**
|
||||
* @brief Delete the current node.
|
||||
* @attention A successful deletion will cause all interfaces to the current node to become inoperable.
|
||||
* @return Returns whether the deletion was successful.
|
||||
*/
|
||||
boolean DeleteNode();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Interface allowing access to table and array nodes.
|
||||
*/
|
||||
interface INodeCollection
|
||||
{
|
||||
/**
|
||||
* @brief Returns the amount of nodes.
|
||||
* @return The amount of nodes.
|
||||
*/
|
||||
uint32 GetCount() const;
|
||||
|
||||
/**
|
||||
* @brief Get the node.
|
||||
* @param[in] uiIndex Index of the node to get.
|
||||
* @return Interface to the node object.
|
||||
*/
|
||||
IInterfaceAccess GetNode(in uint32 uiIndex) const;
|
||||
|
||||
/**
|
||||
* @brief Searches a node by its key in the parse tree
|
||||
* @details Elements of tables can be accessed and traversed by using '.' to separated the parent name from child
|
||||
* name. E.g. 'parent.child' would access the 'child' element of the 'parent' table. Elements of arrays can be
|
||||
* accessed and traversed by using the index number in brackets. E.g. 'array[3]' would access the fourth element of
|
||||
* the array 'array'. These access conventions can also be chained like 'table.array[2][1].subtable.integerElement'.
|
||||
* @attention Array indexing starts with 0!
|
||||
* @param[in] ssPath The path of the Node to searched for.
|
||||
* @return Returns an interface the requested node if available.
|
||||
*/
|
||||
IInterfaceAccess GetNodeDirect(in u8string ssPath) const;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Convert between inline and standard definitions.
|
||||
*/
|
||||
interface INodeCollectionConvert
|
||||
{
|
||||
/**
|
||||
* @brief Can the node convert to an inline definition?
|
||||
* @return Returns whether the conversion to inline is possible. Returns 'true' when the node is already inline.
|
||||
*/
|
||||
boolean CanMakeInline() const;
|
||||
|
||||
/**
|
||||
* @brief Convert the node to an inline node.
|
||||
* @return Returns whether the conversion was successful. Returns 'true' when the node was already inline.
|
||||
*/
|
||||
boolean MakeInline();
|
||||
|
||||
/**
|
||||
* @brief Can the node convert to a standard definition?
|
||||
* @return Returns whether the conversion to standard is possible. Returns 'true' when the node is already defined as
|
||||
* standard node.
|
||||
*/
|
||||
boolean CanMakeStandard() const;
|
||||
|
||||
/**
|
||||
* @brief Convert the node to a standard node.
|
||||
* @return Returns whether the conversion was successful. Returns 'true' when the node was already defined as standard
|
||||
* node.
|
||||
*/
|
||||
boolean MakeStandard();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Extend the collection node with values, arrays and tables.
|
||||
*/
|
||||
interface INodeCollectionInsert
|
||||
{
|
||||
/**
|
||||
* @brief Insert a value into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Value nodes cannot be inserted behind external
|
||||
* tables and table arrays. If the index is referencing a position behind an external table or a table array, the index
|
||||
* is automatically corrected.
|
||||
* @param[in] ssName Name of the node to insert. Will be ignored for an array collection. The name must adhere to the
|
||||
* key names defined by the TOML specification. Defining the key multiple times is not allowed. Quotation of key names
|
||||
* is done automatically; the parser decides itself whether the key is bare-key, a literal key or a quoted key.
|
||||
* @param[in] anyValue The value of the node, being either an integer, floating point number, boolean value or a string.
|
||||
* Conversion is automatically done to int64, double float, bool or u8string.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertValue(in uint32 uiIndex, in u8string ssName, in any anyValue);
|
||||
|
||||
/**
|
||||
* @brief Insert an array into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Array nodes cannot be inserted behind external
|
||||
* tables and table arrays. If the index is referencing a position behind an external table or a table array, the index
|
||||
* is automatically corrected.
|
||||
* @param[in] ssName Name of the array node to insert. Will be ignored if the current node is also an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertArray(in uint32 uiIndex, in u8string ssName);
|
||||
|
||||
/**
|
||||
* @brief Insertion preference for tables and table arrays, being standard or inline.
|
||||
*/
|
||||
enum EInsertPreference
|
||||
{
|
||||
prefer_standard = 0, ///< When the parent node is not inline, the node will be inserted as standard node.
|
||||
prefer_inline = 1, ///< The node will be inserted as inline node.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Insert a table into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Table nodes cannot be inserted before value nodes
|
||||
* or arrays. If the index is referencing a position before a value node or an array, the index is automatically
|
||||
* corrected.
|
||||
* @param[in] ssName Name of the table node to insert. Will be ignored if the parent node is an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @param[in] ePreference The preferred form of the node to be inserted.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertTable(in uint32 uiIndex, in u8string ssName, in EInsertPreference ePreference);
|
||||
|
||||
/**
|
||||
* @brief Insert a table array into the collection at the location before the supplied index.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Table array nodes cannot be inserted before value
|
||||
* nodes or arrays. If the index is referencing a position before a value node or an array, the index is automatically
|
||||
* corrected.
|
||||
* @param[in] ssName Name of the array node to insert. Will be ignored if the parent node is also an array collection.
|
||||
* The name must adhere to the key names defined by the TOML specification. Defining the key multiple times is not
|
||||
* allowed. Quotation of key names is done automatically; the parser decides itself whether the key is bare-key, a
|
||||
* literal key or a quoted key.
|
||||
* @param[in] ePreference The preferred form of the node to be inserted.
|
||||
* @return On success the interface to the newly inserted node is returned or NULL otherwise.
|
||||
*/
|
||||
IInterfaceAccess InsertTableArray(in uint32 uiIndex, in u8string ssName, in EInsertPreference ePreference);
|
||||
|
||||
/**
|
||||
* @brief The result of the TOML string to insert.
|
||||
*/
|
||||
enum EInsertResult : uint32
|
||||
{
|
||||
insert_fail, ///< The TOML string was invalid or didn't fit the collection node it was to be inserted.
|
||||
insert_partly_success, ///< Part, but not all nodes could be inserted (duplicate nodes are not inserted).
|
||||
insert_success, ///< All nodes could be inserted or the TOML didn't contain any nodes.
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Insert a TOML string as a child of the current collection node. If the collection is a table, the TOML string
|
||||
* should contain values and inline/external/array-table nodes with names. If the collection is an array, the TOML
|
||||
* string should contain and inline table nodes without names.
|
||||
* @attention Even though the TOML might be defining the node(s) in standard form, if the parent node is an inline node,
|
||||
* the node will be inserted as inline node.
|
||||
* @param[in] uiIndex The insertion location to insert the node before. Can be npos or any value larger than the
|
||||
* collection count to insert the node at the end of the collection. Table array nodes cannot be inserted before value
|
||||
* nodes or arrays. If the index is referencing a position before a value node or an array, the index is automatically
|
||||
* corrected.
|
||||
* @param[in] ssTOML The TOML string to insert. This string can hold one or more nodes that should be inserted.
|
||||
* @param[in] bRollbackOnFailure If only part of the nodes could be inserted, no node will be inserted.
|
||||
* @return The result of the insertion.
|
||||
*/
|
||||
EInsertResult InsertTOML(in uint32 uiIndex, in u8string ssTOML, in boolean bRollbackOnFailure);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user