it builds, ship it

This commit is contained in:
Kevin Darby committed 2019-09-26 12:33:42 -04:00
1 parent 719fd03063
commit e1c2d8aaaf
10 files changed
+84 -43

No files matched your search

+14 -2
View File
@@ -9,13 +9,14 @@ namespace fix {
struct SecurityIndex::PImpl
{
md::DescHandleIndex index;
PImpl(const md::MDClient& md) : index(md)
md::KeyHandleIndex key_index;
PImpl(md::MDClient& md) : index(md), key_index(md)
{
}
};
SecurityIndex::SecurityIndex(const md::MDClient& md) : me(new PImpl(md))
SecurityIndex::SecurityIndex(md::MDClient& md) : me(new PImpl(md))
{
}
@@ -43,6 +44,17 @@ md::SecurityPtr SecurityIndex::lookup(const std::string& desc)
return ptr;
}
md::SecurityPtr SecurityIndex::lookup(md::security_key key)
{
md::SecurityPtr ptr = nullptr;
me->key_index.security_index.lock([&ptr, &key] (const auto& secmap)
{
auto it = secmap.find( SecurityKey(key) );
if(it != secmap.end())
ptr = it->second;
});
return ptr;
}
}}