Align runtime skeleton with storage event UML

This commit is contained in:
liu weikai
2026-06-15 01:00:03 +08:00
parent 93368f29ef
commit f055d36fd5
7 changed files with 707 additions and 29 deletions
@@ -86,7 +86,8 @@ class IMapTileWorkerBackend
class MapTileAsyncRuntime
{
public:
explicit MapTileAsyncRuntime(IMapTileCommandSink& commands);
explicit MapTileAsyncRuntime(IMapTileCommandSink& commands,
sys::runtime::RuntimePolicyStrategy* policy = nullptr);
uint32_t activeGeneration() const;
std::size_t requestVisibleTiles(const MapViewportPlan& plan, uint32_t now_ms);
@@ -94,8 +95,12 @@ class MapTileAsyncRuntime
private:
static sys::runtime::RuntimePriority priorityFor(MapTileInteractionMode mode);
sys::runtime::RuntimeCommand commandFromIntent(const sys::runtime::RuntimeIntent& intent);
IMapTileCommandSink& commands_;
sys::runtime::DefaultRuntimePolicyStrategy default_policy_{};
sys::runtime::RuntimePolicyStrategy* policy_ = nullptr;
sys::runtime::RuntimeState state_{};
uint32_t active_generation_ = 0;
uint32_t next_command_id_ = 1;
};
@@ -107,16 +112,17 @@ class MapTileWorker
sys::runtime::IBusArbiter& bus,
IMapTileEventSink& events,
uint8_t* scratch,
std::size_t scratch_size);
std::size_t scratch_size,
sys::runtime::RuntimePolicyStrategy* policy = nullptr);
bool execute(const LoadTileCommand& command, uint32_t now_ms);
private:
static sys::runtime::BusAccessPolicy busPolicyFor(sys::runtime::RuntimePriority priority);
IMapTileWorkerBackend& backend_;
sys::runtime::IBusArbiter& bus_;
IMapTileEventSink& events_;
sys::runtime::DefaultRuntimePolicyStrategy default_policy_{};
sys::runtime::RuntimePolicyStrategy* policy_ = nullptr;
uint8_t* scratch_ = nullptr;
std::size_t scratch_size_ = 0;
};