Add StaticSource::list()

This commit is contained in:
Michael Davidsaver
2020-07-26 20:46:12 -07:00
parent e31e6cda36
commit 80ee77c2ea
2 changed files with 19 additions and 1 deletions
+15 -1
View File
@@ -439,7 +439,7 @@ struct StaticSource::Impl : public Source
{
RWLock lock;
std::map<std::string, SharedPV> pvs;
list_t pvs;
decltype (List::names) list;
virtual void onSearch(Search &op) override
@@ -540,5 +540,19 @@ StaticSource& StaticSource::remove(const std::string& name)
return *this;
}
StaticSource::list_t StaticSource::list() const
{
list_t ret;
if(!impl)
throw std::logic_error("Empty StaticSource");
{
auto G(impl->lock.lockReader());
return impl->pvs; // copies map
}
}
} // namespace server
} // namespace pvxs