Skip to content

Commit

Permalink
Added CatalogInfo class to FacilityInfo. Refs #7866.
Browse files Browse the repository at this point in the history
  • Loading branch information
jawrainey committed Oct 7, 2013
1 parent b8f5ba7 commit 87485a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace Mantid
/// Constructor
CatalogInfo(const Poco::XML::Element* element);
/// Obtain catalog name from the facility file.
std::string catalogName();
const std::string catalogName() const;
/// Obtain soap end point from the facility file.
std::string soapEndPoint();
/// Obtain the regex prefix from the facility file.
Expand Down
6 changes: 4 additions & 2 deletions Code/Mantid/Framework/Kernel/inc/MantidKernel/FacilityInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// Includes
//----------------------------------------------------------------------
#include "MantidKernel/DllConfig.h"
#include "MantidKernel/CatalogInfo.h"
#include "MantidKernel/Logger.h"
#include "MantidKernel/InstrumentInfo.h"
#include "MantidKernel/RemoteJobManager.h"
Expand Down Expand Up @@ -75,10 +76,8 @@ class MANTID_KERNEL_DLL FacilityInfo
const std::string & catalogName()const {return m_catalogName;}
/// Return the archive search interface names
const std::vector<std::string> & archiveSearch() const { return m_archiveSearch; }

/// Returns the name of the default live listener
const std::string & liveListener() const { return m_liveListener; }

/// Returns a list of instruments of this facility
const std::vector<InstrumentInfo> & instruments() const { return m_instruments; }
/// Returns a list of instruments of given technique
Expand All @@ -89,6 +88,8 @@ class MANTID_KERNEL_DLL FacilityInfo
std::vector<std::string> computeResources() const;
/// Returns the RemoteJobManager for the named compute resource
boost::shared_ptr<RemoteJobManager> getRemoteJobManager( const std::string &name) const;
/// Returns the catalogInfo class.
const CatalogInfo& catalogInfo() const { return m_catalogs; }

private:
void fillZeroPadding(const Poco::XML::Element* elem);
Expand All @@ -103,6 +104,7 @@ class MANTID_KERNEL_DLL FacilityInfo
/// Add new extension
void addExtension(const std::string& ext);

CatalogInfo m_catalogs; ///< Gain access to the catalogInfo class.
const std::string m_name; ///< facility name
int m_zeroPadding; ///< default zero padding for this facility
std::string m_delimiter; ///< default delimiter between instrument name and run number
Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/Framework/Kernel/src/CatalogInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace Mantid
/**
* Obtain catalog name from the facility file.
*/
std::string CatalogInfo::catalogName()
const std::string CatalogInfo::catalogName() const
{
return (m_catalogName);
}
Expand Down
10 changes: 4 additions & 6 deletions Code/Mantid/Framework/Kernel/src/FacilityInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "MantidKernel/Strings.h"
#include "MantidKernel/Exception.h"
#include "MantidKernel/ConfigService.h"
#include "MantidKernel/CatalogInfo.h"

#include <Poco/DOM/Element.h>
#include <Poco/DOM/NodeList.h>
Expand All @@ -28,8 +27,8 @@ Logger& FacilityInfo::g_log(Logger::get("FacilityInfo"));
* @param elem :: The Poco::XML::Element to read the data from
* @throw std::runtime_error if name or file extensions are not defined
*/
FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) :
m_name(elem->getAttribute("name")), m_zeroPadding(0), m_delimiter(), m_extensions(),
FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) :
m_catalogs(elem), m_name(elem->getAttribute("name")), m_zeroPadding(0), m_delimiter(), m_extensions(),
m_soapEndPoint(), m_archiveSearch(), m_instruments(), m_catalogName(), m_liveListener(),
m_computeResources()
{
Expand All @@ -44,10 +43,9 @@ FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) :
fillDelimiter(elem);
fillExtensions(elem);

Mantid::Kernel::CatalogInfo catalog(elem);
// Make use of the catalog class to set related attributes.
m_soapEndPoint = catalog.soapEndPoint();
m_catalogName = catalog.catalogName();
m_soapEndPoint = m_catalogs.soapEndPoint();
m_catalogName = m_catalogs.catalogName();

fillArchiveNames(elem);
fillLiveListener(elem);
Expand Down

0 comments on commit 87485a4

Please sign in to comment.