Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstracts MapStore and MapLane over the underlying map implementation. #739

Open
wants to merge 15 commits into
base: cleanup
Choose a base branch
from

Conversation

horned-sphere
Copy link
Collaborator

It is now possible to change the underlying map used by MapStore and MapLane. This allows:

  1. MapLane<K, V, HashMap<K, V, S>> - Specifying a custom hash implementation for hash maps.
  2. MapLane<K, V, BTreeMap<K, V>> - Specifying an ordered standard library B-tree map.

This behaviour is enabled by two new traits swimos_agen::map_storage::MapOps and swimos_agen::map_storage::MapOpsWithEntry. Currently these are only implement for the standard library HashMap and BTreeMap types and are not exposed in the public API (so uses can't add support for more map types).

The type of the map is optional and:

MapLane<K, V> == MapLane<K, V, HashMap<K, V>>

Copy link

codecov bot commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 47.33728% with 89 lines in your changes missing coverage. Please review.

Project coverage is 49.40%. Comparing base (8da461a) to head (a339ab1).

Files with missing lines Patch % Lines
...r/swimos_agent_derive/src/agent_lifecycle/model.rs 0.00% 49 Missing ⚠️
...r/swimos_agent_derive/src/lane_model_derive/mod.rs 0.00% 23 Missing ⚠️
server/swimos_agent/src/map_storage/mod.rs 86.84% 5 Missing ⚠️
...swimos_agent_derive/src/lane_model_derive/model.rs 0.00% 5 Missing ⚠️
...er/swimos_agent/src/agent_lifecycle/utility/mod.rs 0.00% 2 Missing ⚠️
...r/swimos_agent/src/lanes/map/lifecycle/on_clear.rs 0.00% 2 Missing ⚠️
.../swimos_agent/src/lanes/map/lifecycle/on_remove.rs 0.00% 2 Missing ⚠️
...ver/swimos_agent_derive/src/agent_lifecycle/mod.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           cleanup     #739      +/-   ##
===========================================
+ Coverage    49.37%   49.40%   +0.03%     
===========================================
  Files          401      401              
  Lines        34942    34957      +15     
===========================================
+ Hits         17251    17269      +18     
+ Misses       17691    17688       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@horned-sphere horned-sphere marked this pull request as ready for review November 22, 2024 17:07
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