Add StaticSource::list()
This commit is contained in:
+15
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user