1
This commit is contained in:
parent
fe6587fdc7
commit
f58185b947
@ -213,6 +213,16 @@ std::shared_ptr<GSNode> GSMgr::GetNodeByNodeKey(const std::string& node_key)
|
|||||||
return itr != node_key_hash_.end() ? itr->second : nullptr;
|
return itr != node_key_hash_.end() ? itr->second : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::shared_ptr<GSNode> GSMgr::GetNodeByInstanceId(int instance_id)
|
||||||
|
{
|
||||||
|
for (auto& pair : node_key_hash_) {
|
||||||
|
if (pair.second->instance_id == instance_id) {
|
||||||
|
return pair.second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<GSNode> GSMgr::AllocNode()
|
std::shared_ptr<GSNode> GSMgr::AllocNode()
|
||||||
{
|
{
|
||||||
std::vector<std::shared_ptr<GSNode>>* sorted_nodes = GetSortedNodes();
|
std::vector<std::shared_ptr<GSNode>>* sorted_nodes = GetSortedNodes();
|
||||||
|
@ -32,6 +32,7 @@ class GSMgr : public a8::Singleton<GSMgr>
|
|||||||
private:
|
private:
|
||||||
std::shared_ptr<GSNode> GetNodeByTeamId(const std::string& team_id);
|
std::shared_ptr<GSNode> GetNodeByTeamId(const std::string& team_id);
|
||||||
std::shared_ptr<GSNode> GetNodeByNodeKey(const std::string& node_key);
|
std::shared_ptr<GSNode> GetNodeByNodeKey(const std::string& node_key);
|
||||||
|
std::shared_ptr<GSNode> GetNodeByInstanceId(int instance_id);
|
||||||
std::shared_ptr<GSNode> AllocNode();
|
std::shared_ptr<GSNode> AllocNode();
|
||||||
void RearrangeNode();
|
void RearrangeNode();
|
||||||
void AddNodeToSortedNodes(std::shared_ptr<GSNode> node);
|
void AddNodeToSortedNodes(std::shared_ptr<GSNode> node);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user