mirror of
https://github.com/SapphireServer/Sapphire.git
synced 2025-05-05 10:17:46 +00:00
Lookup functions for linkshells
This commit is contained in:
parent
fbf6a84a61
commit
b62e0bee51
2 changed files with 21 additions and 0 deletions
|
@ -60,3 +60,21 @@ bool Core::LinkshellMgr::loadLinkshells()
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Core::LinkshellPtr Core::LinkshellMgr::getLinkshellByName( const std::string& name )
|
||||||
|
{
|
||||||
|
auto it = m_linkshellNameMap.find( name );
|
||||||
|
if( it == m_linkshellNameMap.end() )
|
||||||
|
return nullptr;
|
||||||
|
else
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
Core::LinkshellPtr Core::LinkshellMgr::getLinkshellById( uint64_t lsId )
|
||||||
|
{
|
||||||
|
auto it = m_linkshellIdMap.find( lsId );
|
||||||
|
if( it == m_linkshellIdMap.end() )
|
||||||
|
return nullptr;
|
||||||
|
else
|
||||||
|
return it->second;
|
||||||
|
}
|
||||||
|
|
|
@ -15,6 +15,9 @@ private:
|
||||||
std::map< uint32_t, LinkshellPtr > m_linkshellIdMap;
|
std::map< uint32_t, LinkshellPtr > m_linkshellIdMap;
|
||||||
std::map< std::string, LinkshellPtr > m_linkshellNameMap;
|
std::map< std::string, LinkshellPtr > m_linkshellNameMap;
|
||||||
|
|
||||||
|
LinkshellPtr getLinkshellByName( const std::string& name );
|
||||||
|
LinkshellPtr getLinkshellById( uint64_t lsId );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LinkshellMgr();
|
LinkshellMgr();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue