Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1a3e15b
initial commit
shawnkchan Nov 24, 2025
5abe26f
feat: add header file for order_graph_validator
shawnkchan Nov 24, 2025
7ddb89c
feat: add unit tests for order_graph_validator
shawnkchan Nov 24, 2025
803a323
fix: use vda5050_types
shawnkchan Nov 24, 2025
12fd3a1
fix: use vda5050_types in tests
shawnkchan Nov 24, 2025
cae3c3b
chore: add package and tests to cmake
shawnkchan Nov 24, 2025
becce38
fix: fix linting errors
shawnkchan Nov 24, 2025
2e9ca5b
refactor: place order_graph_validator in order directort
shawnkchan Nov 28, 2025
ef4bccc
refactor: place order_graph_validator in client directory
shawnkchan Nov 28, 2025
135c0c3
refactor: move order_graph_manager into client/order directory
shawnkchan Nov 28, 2025
6179f8c
refactor: move order_graph_validator into vda5050_core::client::order…
shawnkchan Nov 28, 2025
0c8a8f0
refactor: update order_graph_validator to use VDA5050 logging macros …
shawnkchan Nov 28, 2025
a771210
feat: crete validation_result struct for more detailed error reporting
shawnkchan Nov 28, 2025
6061e79
fix: reimplement is_in_traversal_order function
shawnkchan Nov 28, 2025
acb2a96
refactor: update tests according to new order_graph_validator
shawnkchan Nov 28, 2025
2d69c21
feat: add equality and inequality operators for testing purposes
shawnkchan Nov 28, 2025
5647d38
chore: update CMakeLists
shawnkchan Nov 28, 2025
77aee79
style: apply clang-format
shawnkchan Nov 30, 2025
b8ac8d5
style: apply clang-format to order_graph_validator test
shawnkchan Nov 30, 2025
29e1e43
chore: disable if else style check for cpplint during testing
shawnkchan Dec 1, 2025
fd04ac0
style: add space before comment
shawnkchan Dec 1, 2025
58be0ae
refactor: remove equality and inequality checks as tests do not requi…
shawnkchan Dec 1, 2025
d5a6b38
test: make test cases more detailed
shawnkchan Dec 1, 2025
42d6a64
refactor: change Error Level of graph validation errors to WARNING in…
shawnkchan Dec 1, 2025
ce90e6f
feat: add function checking for valid sequenceIds
shawnkchan Dec 3, 2025
fb2f40d
feat: create graph_element struct for easier management of nodes and …
shawnkchan Dec 3, 2025
553ecdc
refactor: refactor order_graph_manager to do additional checks for gr…
shawnkchan Dec 3, 2025
bce7af2
chore: remove line to find gtest package in CMakeLists
shawnkchan Dec 4, 2025
5cc4b70
chore: make classes explicit
shawnkchan Dec 4, 2025
04c011f
chore: move fmt header to top of file
shawnkchan Dec 4, 2025
a451f90
chore: temporary change to use "" instead of <> for vda5050_types to …
shawnkchan Dec 5, 2025
8eb611c
fix: change include back to use <> for vda5050_types
shawnkchan Dec 5, 2025
e009b26
feat: update test cases
shawnkchan Dec 5, 2025
8e5f90f
chore: update description of in_traversal_order()
shawnkchan Dec 5, 2025
c7faa4b
refactor: revised graph validator and test cases
Johnarman1398 Dec 13, 2025
1b3d073
chore: lint
Johnarman1398 Dec 13, 2025
ee9200c
chore: lint
Johnarman1398 Dec 13, 2025
1f87a73
chore: merged changes from develop
Johnarman1398 Dec 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions vda5050_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ target_include_directories(logger
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

add_library(client src/vda5050_core/state_manager/state_manager.cpp)
add_library(client
src/vda5050_core/state_manager/state_manager.cpp
src/vda5050_core/client/order/order_graph_validator.cpp)
target_link_libraries(client
vda5050_types::vda5050_types)
target_include_directories(client
Expand Down Expand Up @@ -79,7 +81,7 @@ install(
)

ament_export_targets(export_vda5050_core HAS_LIBRARY_TARGET)
ament_export_dependencies(PahoMqttCpp fmt)
ament_export_dependencies(PahoMqttCpp fmt vda5050_types)

if(BUILD_TESTING)
find_package(ament_cmake_cppcheck REQUIRED)
Expand All @@ -106,6 +108,7 @@ if(BUILD_TESTING)
test/unit/mqtt_client/test_mqtt_client_interface.cpp
test/unit/logger/test_logger.cpp
test/unit/logger/test_default_logger.cpp
test/unit/order_graph_validator/test_order_graph_validator.cpp
test/unit/state_manager/test_state_manager.cpp
test/integration/mqtt_client/test_paho_mqtt_client.cpp
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/**
* Copyright (C) 2025 ROS-Industrial Consortium Asia Pacific
* Advanced Remanufacturing and Technology Centre
* A*STAR Research Entities (Co. Registration No. 199702110H)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef VDA5050_CORE__CLIENT__ORDER__ORDER_GRAPH_VALIDATOR_HPP_
#define VDA5050_CORE__CLIENT__ORDER__ORDER_GRAPH_VALIDATOR_HPP_

#include <vector>

#include "vda5050_core/client/order/validation_result.hpp"
#include "vda5050_types/order.hpp"

namespace vda5050_core {
namespace order {

/// \brief Utility class with functions to perform validity checks on the graph
/// contained in a VDA5050 Order message
class OrderGraphValidator
{
public:
OrderGraphValidator() = delete;

/// \brief Checks that the nodes and edges in a VDA5050 Order form a valid
/// graph according to the VDA5050 specification sheet.
///
/// \param order The order to be checked.
/// \return ValidationResult containing if the order being checked is valid,
/// and any errors if it is not.
///
/// \return True if nodes and edges create a valid graph, false otherwise
static ValidationResult is_valid_graph(
const vda5050_types::Order& order) noexcept(false);

/// \brief Checks if order update is valid for order stitching
///
/// \param base_order The base order.
///
/// \param next_order the update order.
///
/// \return True new order is valid for stitching, false otherwise
static ValidationResult is_valid_order_update(
const vda5050_types::Order& base_order,
const vda5050_types::Order& next_order) noexcept(false);
};

} // namespace order
} // namespace vda5050_core

#endif // VDA5050_CORE__CLIENT__ORDER__ORDER_GRAPH_VALIDATOR_HPP_
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* Copyright (C) 2025 ROS-Industrial Consortium Asia Pacific
* Advanced Remanufacturing and Technology Centre
* A*STAR Research Entities (Co. Registration No. 199702110H)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#ifndef VDA5050_CORE__CLIENT__ORDER__VALIDATION_RESULT_HPP_
#define VDA5050_CORE__CLIENT__ORDER__VALIDATION_RESULT_HPP_

#include <vector>

#include "vda5050_types/error.hpp"

namespace vda5050_core {
namespace order {

/// \brief Struct that details the validity of an order
struct ValidationResult
{
/// \brief A vector of error(s) that resulted in an invalid order. Empty if
/// order is valid.
std::vector<vda5050_types::Error> errors;

/// \brief Allows use in boolean contexts
///
/// \return True if the order is valid, false otherwise.
explicit operator bool() const
{
return errors.empty();
}
};

} // namespace order
} // namespace vda5050_core

#endif // VDA5050_CORE__CLIENT__ORDER__VALIDATION_RESULT_HPP_
Loading