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

Merged
merged 16 commits into from
Dec 10, 2024

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.38%. Comparing base (22693a8) to head (650a0c8).
Report is 17 commits behind head on main.

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             @@
##             main     #739      +/-   ##
==========================================
+ Coverage   49.35%   49.38%   +0.02%     
==========================================
  Files         401      401              
  Lines       34994    35009      +15     
==========================================
+ Hits        17272    17289      +17     
+ Misses      17722    17720       -2     

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

@horned-sphere horned-sphere marked this pull request as ready for review November 22, 2024 17:07
Base automatically changed from cleanup to main December 10, 2024 10:21
@SirCipher SirCipher merged commit c21a7ea into main Dec 10, 2024
12 checks passed
@SirCipher SirCipher deleted the flexible-maps branch December 10, 2024 10:50
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