Newer
Older
Campbell, Stuart
committed
std::string defFacility = getString("default.facility");
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
Janik Zikovsky
committed
@param observer :: Reference to the observer to add
Michael Whitty
committed
*/
void ConfigServiceImpl::addObserver(const Poco::AbstractObserver& observer)const
{
m_notificationCenter.addObserver(observer);
}
/** Remove an observer
Janik Zikovsky
committed
@param observer :: Reference to the observer to remove
Michael Whitty
committed
*/
void ConfigServiceImpl::removeObserver(const Poco::AbstractObserver& observer)const
{
m_notificationCenter.removeObserver(observer);
}
Campbell, Stuart
committed
/**
* Get a facility
Janik Zikovsky
committed
* @param fName :: Facility name
* @return the facility information object
Janik Zikovsky
committed
* @throw NotFoundException if the facility is not found
Campbell, Stuart
committed
*/
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