Newer
Older
Campbell, Stuart
committed
if (defFacility.empty())
Roman Tolchenov
committed
{
Campbell, Stuart
committed
defFacility = "ISIS";
Roman Tolchenov
committed
}
Campbell, Stuart
committed
return Facility(defFacility);
}
Michael Whitty
committed
/** Add an observer to a notification
@param observer Reference to the observer to add
*/
void ConfigServiceImpl::addObserver(const Poco::AbstractObserver& observer)const
{
m_notificationCenter.addObserver(observer);
}
/** Remove an observer
@param observer Reference to the observer to remove
*/
void ConfigServiceImpl::removeObserver(const Poco::AbstractObserver& observer)const
{
m_notificationCenter.removeObserver(observer);
}
Campbell, Stuart
committed
/**
* Get a facility
* @param fName Facility name
* @return the facility information object
Campbell, Stuart
committed
* @throws NotFoundException if the facility is not found
*/
const FacilityInfo& ConfigServiceImpl::Facility(const std::string& fName) const
{
std::vector<FacilityInfo*>::const_iterator it = m_facilities.begin();
for (; it != m_facilities.end(); ++it)
Roman Tolchenov
committed
{
Campbell, Stuart
committed
if ((**it).name() == fName)
Roman Tolchenov
committed
{
Campbell, Stuart
committed
return **it;
Roman Tolchenov
committed
}
}
Campbell, Stuart
committed
g_log.error("Facility " + fName + " not found");
throw Exception::NotFoundError("Facilities", fName);
}
/// \cond TEMPLATE
template DLLExport int ConfigServiceImpl::getValue(const std::string&, double&);
template DLLExport int ConfigServiceImpl::getValue(const std::string&, std::string&);
template DLLExport int ConfigServiceImpl::getValue(const std::string&, int&);
/// \endcond TEMPLATE
} // namespace Kernel
} // namespace Mantid