Skip to content
Snippets Groups Projects

Draft: Integrate MantleAPI v12

Open Andreas Rauschert requested to merge integrate_mantle_api_v12 into main
  • Reimplement deleted Mocks that return other mocks on e.g. GetEntityRepository() in test/TestUtils.h as Fake classes
  • Replace mocks with fake classes in tests
  • fix wrong usage of (local) LaneIds and (global) UniqueId for lanes in LateralDistanceAction and ConvertScenarioAbsoluteTargetLaneTest
  • adjust to new getter for entities (weak ptr instead of optional reference wrapper)
  • entities in the repo are now shared ptr instead of unique ptrs (for tests)
  • adjust to new route handling (removed AssignRoute(), add Create() in route repository and SetRoute() in entity)
  • adjust to renaming of members in route definition
  • adjust to redefinition of polynomial in SplineSection (struct instead of tuple)
  • fix namespace for MockStatistics

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • René Paris
    • weak pointer handling needs to be improved
    • I actually doubt that we need to switch from unique_ptrs to shared_ptrs for the entity handling for testing purpose. But I had my issues with forcing the environment to hold entities in a vector of unique_ptrs anyhow. so approved.
  • René Paris requested changes

    requested changes

  • added 2 commits

    Compare with previous version

  • Andreas Rauschert reset approvals from @anastasiiavolkova by pushing to the branch

    reset approvals from @anastasiiavolkova by pushing to the branch

  • René Paris resolved all threads

    resolved all threads

  • 193 193 mantle_api::IEntity& EntityUtils::GetEntityByName(const std::shared_ptr<mantle_api::IEnvironment>& environment,
    • This is dangerous. You create a temporary shared_pointer named entity from locking the given weak_ptr. Then you return the dereferenced pointer to this pointer. Directly after the return entitywill get out of scope and with it the lock, so nobody prevents the memory management to wipe out the actual entity. So you end up with a dangling reference somewhen after calling "GetEntityByName". The only chance to prevent this in this architecture is to return the shared pointer itself.

    • Please register or sign in to reply
  • René Paris requested changes

    requested changes

  • added 1 commit

    • 6c2d069e - Change return type of GetEntityByName to shared_ptr

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading