Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Mantid::API::CatalogManagerImpl Class Reference

This class is a singleton and is responsible for creating, destroying, and managing catalogs. More...

#include <CatalogManager.h>

Public Member Functions

 CatalogManagerImpl (const CatalogManagerImpl &)=delete
 
void destroyCatalog (const std::string &sessionID)
 Destroy a specific catalog (if session provided), otherwise destroys all active catalogs. More...
 
std::vector< CatalogSession_sptrgetActiveSessions ()
 Obtains a list of the current active catalog sessions. More...
 
ICatalog_sptr getCatalog (const std::string &sessionID)
 Get a specific catalog using the sessionID. More...
 
CatalogSession_sptr login (const std::string &username, const std::string &password, const std::string &endpoint, const std::string &facility)
 Creates a new catalog and session, and adds it to the activeCatalogs container. More...
 
size_t numberActiveSessions () const
 Returns the number of active sessions. More...
 
CatalogManagerImploperator= (const CatalogManagerImpl &)=delete
 

Private Member Functions

 CatalogManagerImpl ()=default
 
virtual ~CatalogManagerImpl ()=default
 

Private Attributes

std::map< CatalogSession_sptr, ICatalog_sptrm_activeCatalogs
 

Friends

struct Kernel::CreateUsingNew< CatalogManagerImpl >
 These methods are required to create a singleton. More...
 

Detailed Description

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

Definition at line 24 of file CatalogManager.h.

Constructor & Destructor Documentation

◆ CatalogManagerImpl() [1/2]

Mantid::API::CatalogManagerImpl::CatalogManagerImpl ( const CatalogManagerImpl )
delete

◆ CatalogManagerImpl() [2/2]

Mantid::API::CatalogManagerImpl::CatalogManagerImpl ( )
privatedefault

◆ ~CatalogManagerImpl()

virtual Mantid::API::CatalogManagerImpl::~CatalogManagerImpl ( )
privatevirtualdefault

Member Function Documentation

◆ destroyCatalog()

void Mantid::API::CatalogManagerImpl::destroyCatalog ( const std::string &  sessionID)

Destroy a specific catalog (if session provided), otherwise destroys all active catalogs.

Destroy and remove a specific catalog from the active catalogs list and the composite catalog.

If sessionID is empty then all catalogs are removed from the active catalogs list.

Parameters
sessionID:: The session to search for in the active catalogs list.

Definition at line 76 of file CatalogManager.cpp.

References m_activeCatalogs.

◆ getActiveSessions()

std::vector< CatalogSession_sptr > Mantid::API::CatalogManagerImpl::getActiveSessions ( )

Obtains a list of the current active catalog sessions.

Returns
A list of active catalog sessions.

Definition at line 97 of file CatalogManager.cpp.

References m_activeCatalogs.

◆ getCatalog()

ICatalog_sptr Mantid::API::CatalogManagerImpl::getCatalog ( const std::string &  sessionID)

Get a specific catalog using the sessionID.

Obtain a specific catalog using the sessionID, otherwise return all active catalogs.

Parameters
sessionID:: The session to search for in the active catalogs list.
Returns
A specific catalog using the sessionID, otherwise returns all active catalogs

Definition at line 46 of file CatalogManager.cpp.

References m_activeCatalogs.

◆ login()

CatalogSession_sptr Mantid::API::CatalogManagerImpl::login ( const std::string &  username,
const std::string &  password,
const std::string &  endpoint,
const std::string &  facility 
)

Creates a new catalog and session, and adds it to the activeCatalogs container.

Logs the user into the catalog if session details are valid.

This is used here as we need to obtain the session for a specific catalog (e.g. the one created on login).

Parameters
username:: The login name of the user.
password:: The password of the user.
endpoint:: The endpoint url of the catalog to log in to.
facility:: The facility of the catalog to log in to.
Returns
The session created if login was successful.

Definition at line 28 of file CatalogManager.cpp.

References Mantid::Kernel::SingletonHolder< T >::Instance(), and m_activeCatalogs.

◆ numberActiveSessions()

size_t Mantid::API::CatalogManagerImpl::numberActiveSessions ( ) const

Returns the number of active sessions.

Returns
An unsigned value indicating the number of active sessions

Definition at line 107 of file CatalogManager.cpp.

References m_activeCatalogs.

Referenced by export_CatalogManager().

◆ operator=()

CatalogManagerImpl & Mantid::API::CatalogManagerImpl::operator= ( const CatalogManagerImpl )
delete

Friends And Related Function Documentation

◆ Kernel::CreateUsingNew< CatalogManagerImpl >

friend struct Kernel::CreateUsingNew< CatalogManagerImpl >
friend

These methods are required to create a singleton.

Definition at line 40 of file CatalogManager.h.

Member Data Documentation

◆ m_activeCatalogs

std::map<CatalogSession_sptr, ICatalog_sptr> Mantid::API::CatalogManagerImpl::m_activeCatalogs
private

The documentation for this class was generated from the following files: