add StaticSource::close()

This commit is contained in:
Michael Davidsaver
2020-07-23 13:23:38 -07:00
parent ce80e8897b
commit e8649ecdd2
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -506,6 +506,20 @@ std::shared_ptr<Source> StaticSource::source() const
return impl;
}
void StaticSource::close()
{
if(!impl)
throw std::logic_error("Empty StaticSource");
{
auto G(impl->lock.lockReader());
for(auto& pair : impl->pvs) {
pair.second.close();
}
}
}
StaticSource& StaticSource::add(const std::string& name, const SharedPV &pv)
{
if(!impl)