MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / get_latest_node

Method get_latest_node

source/MaaFramework/Tasker/RuntimeCache.cpp:8–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "MaaUtils/Logger.h"
7
8MAA_NS_BEGIN
9
10std::optional<MaaNodeId> RuntimeCache::get_latest_node(const std::string& name) const
11{
12 if (name.empty()) {
13 LogWarn << "name is empty";
14 return std::nullopt;
15 }
16
17 std::shared_lock lock(latest_nodes_mutex_);
18
19 auto it = latest_nodes_.find(name);
20 if (it == latest_nodes_.end()) {
21 return std::nullopt;
22 }
23 return it->second;
24}
25
26void RuntimeCache::set_latest_node(const std::string& name, MaaNodeId id)
27{

Callers

nothing calls this directly

Calls 2

emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected