Skip to content

replaced score::cpp with std#231

Draft
marwan275 wants to merge 1 commit intoeclipse-score:mainfrom
marwan275:moma_use_std
Draft

replaced score::cpp with std#231
marwan275 wants to merge 1 commit intoeclipse-score:mainfrom
marwan275:moma_use_std

Conversation

@marwan275
Copy link
Copy Markdown

@marwan275 marwan275 commented Mar 24, 2026

Summary

This PR migrates the mw/com tracing code to use the new type-safe ServiceInstanceElement interface introduced in eclipse-score/baselibs#be21786.

Motivation

The migration from score::cpp::variant (amp::variant) to std::variant requires distinct struct types for variant alternatives since std::variant cannot distinguish between multiple uint32_t aliases. The baselibs repository introduced new wrapper structs (EventId, FieldId, MethodId) alongside a StdVariantType alias for std::variant<EventId, FieldId, MethodId>.

Changes

Before After
score::cpp::optional<T> std::optional<T>
score::cpp::get_if<T>() std::get_if<T>()
ServiceInstanceElement::EventIdType ServiceInstanceElement::EventId (struct)
ServiceInstanceElement::FieldIdType ServiceInstanceElement::FieldId (struct)
ServiceInstanceElement::VariantType ServiceInstanceElement::StdVariantType
EventIdType = 42U EventId{42U}

Dependencies

  • Requires baselibs with commit be21786 (new type-safe ServiceInstanceElement interface)

Testing

All existing unit tests updated to use the new interface.

@castler
Copy link
Copy Markdown
Contributor

castler commented Mar 27, 2026

Marking as draft, until basic build works.

@castler castler marked this pull request as draft March 27, 2026 15:06
@marwan275 marwan275 force-pushed the moma_use_std branch 4 times, most recently from 76cf49b to a355a4b Compare April 9, 2026 09:01
- Replace score::cpp::optional with std::optional in all tracing
  interfaces, mocks, and tests
- Add std::optional to score::cpp::optional conversion bridge in
  tracing_runtime.cpp for baselibs API compatibility
- Replace static_cast<EventIdType/FieldIdType>() with brace init
  EventIdType{}/FieldIdType{} in lola tracing runtime and test
- Migrate to StdVariantType with EventId{} struct wrapper
- Revert std::get_if/std::get to score::cpp::get_if/score::cpp::get
  where MetaInfoVariants::Type (score::cpp::variant) is used
- Remove #include <score/optional.hpp>, add #include <optional>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants