Conversation
|
Marking as draft, until basic build works. |
a355a4b to
5d173d4
Compare
459f9f0 to
c1b0a4f
Compare
limdor
left a comment
There was a problem hiding this comment.
Not a full reveiw yet, but some preliminary feedback.
There are too many unrelated changes in a single commit, this is not only replacing score::optional for std::optional. Please split the changes in different commits that it is easier to review and see what it is going on.
| service_element_instance_identifier_view_, | ||
| trace_point_, | ||
| score::cpp::optional<TracingRuntime::TracePointDataId>{trace_point_data_id_}, | ||
| std::optional<TracingRuntime::TracePointDataId>{trace_point_data_id_}, |
There was a problem hiding this comment.
You missed removing the #include <score/optional.hpp> include and adding the #include <optional>
| git_override( | ||
| module_name = "score_baselibs", | ||
| commit = "69bd8297dc5de97db3362d8ea1da634883e7c27a", | ||
| commit = "a93a5b3b0a465593703834d84d6d6a64567b0307", |
There was a problem hiding this comment.
Please explain why this is needed. If we need something newer we should just wait for a new release of baselibs. I do not see why we should hurry on having this change.
There was a problem hiding this comment.
The baselibs bump from 69bd829 to a93a5b3b is required because this PR uses the StdVariantType constructor of ServiceInstanceElement (line 327 in tracing_runtime.cpp). At commit 69bd829, the StdVariantType alias and wrapper structs (EventId, FieldId) exist but the class has no explicit constructors — it's an aggregate. The explicit constructor accepting StdVariantType was added later in baselibs@9c53270. Without this bump, the examples integration test fails because aggregate initialization cannot convert StdVariantType (std::variant) to VariantType (score::cpp::variant) for the element_id member.
Replace score::cpp:: with std:: in baselibs
|
- score::cpp::optional → std::optional across tracing interfaces, skeleton event bindings, mocks, and tests - ServiceInstanceElement: adopt type-safe StdVariantType (std::variant<EventId, FieldId, MethodId>) replacing index-based VariantType (score::cpp::variant<uint32_t, uint32_t, uint32_t>) - Remove unused score/optional.hpp includes and BUILD deps - Bump score_baselibs to a93a5b3b for StdVariantType constructor
Summary
Migrates
mw/comtracing and skeleton event code fromscore::cpptypes to theirstdequivalents, and adopts the new type-safeServiceInstanceElementinterface from baselibs.Motivation
As part of the ongoing migration from
score::cppwrappers to standard C++ types, this PR replaces deprecated types with theirstdcounterparts and leverages the new type-safeServiceInstanceElementvariant interface introduced in eclipse-score/baselibs@be21786. Usingstd::variantwith distinct wrapper structs (EventId,FieldId,MethodId) instead ofscore::cpp::variant<uint32_t, uint32_t, uint32_t>eliminates reliance on index-based access and makes the variant type-safe.Changes
Type migrations
score::cpp::optional<T>std::optional<T>score::cpp::nulloptstd::nulloptscore::cpp::variant(index-based)std::variant(type-safe)ServiceInstanceElement::EventIdType(uint32_talias)ServiceInstanceElement::EventId(struct wrapper)ServiceInstanceElement::FieldIdType(uint32_talias)ServiceInstanceElement::FieldId(struct wrapper)ServiceInstanceElement::VariantTypeServiceInstanceElement::StdVariantType#include <score/optional.hpp>#include <optional>Key code changes
ServiceInstanceElementusing the newStdVariantTypeconstructor withEventId{}/FieldId{}struct wrappers instead of assigning rawuint32_tto aggregate members with index-based variant placement.skeleton_event_binding.h:Send()signature changed fromscore::cpp::optional<SendTraceCallback>tostd::optional<SendTraceCallback>, propagated through all implementations (lola, mock_binding) and tests.common_event_tracing.h/cpp:TraceData()parameter migrated tostd::optional.i_binding_tracing_runtime.h/i_tracing_runtime.h: Interface methods migrated to returnstd::optional.skeleton_event_tracing.h: Callbacks usestd::optional.configuration_common_resources.h/binding_service_type_deployment_impl.h: Explicitscore::cpp::string_viewtype annotation to avoid implicit conversion issues afterautotype deduction changes.examples/MODULE.bazel: Bumpedscore_baselibstoa93a5b3bwhich includes theStdVariantTypeconstructor (commit9c53270e).BUILDfiles: Removed unused@score_baselibs//score/language/futurecpp:optionaldependency from 3 test targets.Dependencies
score_baselibsat commita93a5b3bor later (includesbe21786for type-safe structs +9c53270efor explicit constructors).Testing
All existing unit tests updated to use the new interface. No behavioral changes — this is a pure type migration.