Skip to content

Commit

Permalink
Refs #8849. Merge remote-tracking branch 'origin/master' into 8849
Browse files Browse the repository at this point in the history
Conflicts:
	Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/MuonAnalysisOptionTab.h
	Code/Mantid/MantidQt/CustomInterfaces/src/MuonAnalysisOptionTab.cpp
  • Loading branch information
arturbekasov committed Mar 7, 2014
2 parents a277a12 + 6d71488 commit 953185d
Show file tree
Hide file tree
Showing 141 changed files with 4,127 additions and 4,517 deletions.
14 changes: 6 additions & 8 deletions Code/Mantid/Framework/API/CMakeLists.txt
Expand Up @@ -12,9 +12,12 @@ set ( SRC_FILES
src/Axis.cpp
src/BoxController.cpp
src/CatalogFactory.cpp
src/CatalogManager.cpp
src/CatalogSession.cpp
src/ChopperModel.cpp
src/Column.cpp
src/ColumnFactory.cpp
src/CompositeCatalog.cpp
src/CompositeDomainMD.cpp
src/CompositeFunction.cpp
src/ConstraintFactory.cpp
Expand Down Expand Up @@ -69,8 +72,6 @@ set ( SRC_FILES
src/JointDomain.cpp
src/LinearScale.cpp
src/LiveListenerFactory.cpp
src/LocatedDataRef.cpp
src/LocatedDataValue.cpp
src/LogManager.cpp
src/LogarithmScale.cpp
src/MDGeometry.cpp
Expand Down Expand Up @@ -135,9 +136,12 @@ set ( INC_FILES
inc/MantidAPI/Axis.h
inc/MantidAPI/BoxController.h
inc/MantidAPI/CatalogFactory.h
inc/MantidAPI/CatalogManager.h
inc/MantidAPI/CatalogSession.h
inc/MantidAPI/ChopperModel.h
inc/MantidAPI/Column.h
inc/MantidAPI/ColumnFactory.h
inc/MantidAPI/CompositeCatalog.h
inc/MantidAPI/CompositeDomain.h
inc/MantidAPI/CompositeDomainMD.h
inc/MantidAPI/CompositeFunction.h
Expand Down Expand Up @@ -174,7 +178,6 @@ set ( INC_FILES
inc/MantidAPI/ICatalogInfoService.h
inc/MantidAPI/IConstraint.h
inc/MantidAPI/ICostFunction.h
inc/MantidAPI/IDataItem.h
inc/MantidAPI/IDomainCreator.h
inc/MantidAPI/IEventList.h
inc/MantidAPI/IEventWorkspace.h
Expand All @@ -187,7 +190,6 @@ set ( INC_FILES
inc/MantidAPI/IFunctionValues.h
inc/MantidAPI/IFunctionWithLocation.h
inc/MantidAPI/ILiveListener.h
inc/MantidAPI/ILocatedData.h
inc/MantidAPI/IMDEventWorkspace.h
inc/MantidAPI/IMDHistoWorkspace.h
inc/MantidAPI/IMDIterator.h
Expand Down Expand Up @@ -217,8 +219,6 @@ set ( INC_FILES
inc/MantidAPI/JointDomain.h
inc/MantidAPI/LinearScale.h
inc/MantidAPI/LiveListenerFactory.h
inc/MantidAPI/LocatedDataRef.h
inc/MantidAPI/LocatedDataValue.h
inc/MantidAPI/LogManager.h
inc/MantidAPI/LogarithmScale.h
inc/MantidAPI/MDGeometry.h
Expand Down Expand Up @@ -260,8 +260,6 @@ set ( INC_FILES
inc/MantidAPI/WorkspaceFactory.h
inc/MantidAPI/WorkspaceGroup.h
inc/MantidAPI/WorkspaceHistory.h
inc/MantidAPI/WorkspaceIterator.h
inc/MantidAPI/WorkspaceIteratorCode.h
inc/MantidAPI/WorkspaceOpOverloads.h
inc/MantidAPI/WorkspaceProperty.h
inc/MantidAPI/WorkspaceValidators.h
Expand Down
148 changes: 68 additions & 80 deletions Code/Mantid/Framework/API/inc/MantidAPI/CatalogFactory.h
Expand Up @@ -25,85 +25,73 @@

namespace Mantid
{
//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
namespace Kernel
{
class Logger;
}
namespace API
{

//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------

class ICatalog;

/** Creates instances of concrete Catalog.
The factory is a singleton that hands out shared pointers to the base Catalog class.
It overrides the base class DynamicFactory::create method so that only a single
instance of a given Catalog is ever created, and a pointer to that same instance
is passed out each time the Catalog is requested.
@author Sofia Antony
@date 01/10/2010
Copyright © 2008 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL CatalogFactoryImpl : public Kernel::DynamicFactory<ICatalog>
{
public:
/// create an instance of the catalog specified by the calssName
virtual boost::shared_ptr<ICatalog> create(const std::string& className) const;

private:
friend struct Kernel::CreateUsingNew<CatalogFactoryImpl>;

/// Private Constructor for singleton class
CatalogFactoryImpl();
/// Private copy constructor
CatalogFactoryImpl(const CatalogFactoryImpl&);
/// Private assignment operator
CatalogFactoryImpl& operator = (const CatalogFactoryImpl&);
///Private Destructor
virtual ~CatalogFactoryImpl();

/// Stores pointers to already created Catalog instances, with their name as the key
mutable std::map< std::string, boost::shared_ptr<ICatalog> > m_createdCatalogs;

/// Reference to the logger class
Kernel::Logger& m_log;
};

///Forward declaration of a specialisation of SingletonHolder for AlgorithmFactoryImpl (needed for dllexport/dllimport) .
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<CatalogFactoryImpl>;
#endif /* _WIN32 */
/// The specialisation of the SingletonHolder class that holds the CatalogFactory
typedef Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> CatalogFactory;

} // namespace API
//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
namespace Kernel
{
class Logger;
}

namespace API
{
//----------------------------------------------------------------------
// Forward declaration
//----------------------------------------------------------------------
class ICatalog;

/**
The factory is a singleton that hands out shared pointers to the base Catalog class.
@author Sofia Antony, ISIS Rutherford Appleton Laboratory
@date 01/10/2010
Copyright &copy; 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL CatalogFactoryImpl : public Kernel::DynamicFactory<ICatalog>
{
private:
friend struct Kernel::CreateUsingNew<CatalogFactoryImpl>;
/// Private Constructor for singleton class
CatalogFactoryImpl();
/// Private copy constructor
CatalogFactoryImpl(const CatalogFactoryImpl&);
/// Private assignment operator
CatalogFactoryImpl& operator = (const CatalogFactoryImpl&);
/// Private Destructor
virtual ~CatalogFactoryImpl();
/// Stores pointers to already created Catalog instances, with their name as the key
mutable std::map< std::string, boost::shared_ptr<ICatalog> > m_createdCatalogs;
/// Reference to the logger class
Kernel::Logger& m_log;
};

///Forward declaration of a specialisation of SingletonHolder for CatalogFactoryImpl (needed for dllexport/dllimport) .
#ifdef _WIN32
// this breaks new namespace declaraion rules; need to find a better fix
template class MANTID_API_DLL Mantid::Kernel::SingletonHolder<CatalogFactoryImpl>;
#endif /* _WIN32 */
/// The specialisation of the SingletonHolder class that holds the CatalogFactory
typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<CatalogFactoryImpl> CatalogFactory;

} // namespace API
} // namespace Mantid

#endif /*MANTID_API_CatalogFACTORYIMPL_H_*/
#endif /*MANTID_API_CATALOGFACTORYIMPL_H_*/
68 changes: 68 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/CatalogManager.h
@@ -0,0 +1,68 @@
#ifndef MANTID_ICAT_CATALOGMANAGERIMPL_H_
#define MANTID_ICAT_CATALOGMANAGERIMPL_H_

#include "MantidKernel/SingletonHolder.h"
#include "MantidAPI/ICatalog.h"

namespace Mantid
{
namespace API
{
/**
This class is a singleton and is responsible for creating, destroying, and managing catalogs.
@author Jay Rainey, ISIS Rutherford Appleton Laboratory
@date 26/02/2014
Copyright &copy; 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL CatalogManagerImpl
{
public:
/// Creates a new catalog and session, and adds it to the activeCatalogs container.
CatalogSession_sptr login(const std::string& username,const std::string& password,
const std::string& endpoint,const std::string& facility);
/// Get a specific catalog using the sessionID.
ICatalog_sptr getCatalog(const std::string &sessionID);
/// Destroy a specific catalog (if session provided), otherwise destroys all active catalogs.
void destroyCatalog(const std::string &sessionID);
/// Obtains a list of the current active catalog sessions.
std::list<CatalogSession_sptr> getActiveSessions();

private:
/// These methods are required to create a singleton.
friend struct Kernel::CreateUsingNew<CatalogManagerImpl>;
CatalogManagerImpl();
CatalogManagerImpl(const CatalogManagerImpl&);
CatalogManagerImpl& operator = (const CatalogManagerImpl&);
virtual ~CatalogManagerImpl();

// Holds a list of active catalogs and uses their sessionId as unique identifier.
std::map<CatalogSession_sptr,ICatalog_sptr> m_activeCatalogs;
};

#ifdef _WIN32
template class MANTID_API_DLL Kernel::SingletonHolder<CatalogManagerImpl>;
#endif
typedef MANTID_API_DLL Kernel::SingletonHolder<CatalogManagerImpl> CatalogManager;

}
}
#endif /* MANTID_ICAT_CATALOGMANAGERIMPL_H_ */
57 changes: 57 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/CatalogSession.h
@@ -0,0 +1,57 @@
#ifndef MANTID_API_CATALOGSESSION_H_
#define MANTID_API_CATALOGSESSION_H_

#include "MantidAPI/DllConfig.h"
#include "boost/shared_ptr.hpp"
#include <string>

namespace Mantid
{
namespace API
{
/**
This class is a responsible for storing session information for a specific catalog.
@author Jay Rainey, ISIS Rutherford Appleton Laboratory
@date 27/02/2014
Copyright &copy; 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL CatalogSession
{
public:
CatalogSession(const std::string &sessionID, const std::string &facility, const std::string &endpoint);
const std::string& getSessionId() const;
void setSessionId(const std::string &sessionID);
const std::string& getSoapEndpoint() const;
const std::string& getFacility() const;

private:
std::string m_sessionID;
std::string m_facility;
std::string m_endpoint;
};

typedef boost::shared_ptr<CatalogSession> CatalogSession_sptr;
typedef boost::shared_ptr<const CatalogSession> CatalogSession_const_sptr;
}
}

#endif /* MANTID_API_CATALOGSESSION_H_ */

0 comments on commit 953185d

Please sign in to comment.