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

Creates instances of concrete transformations into multidimensional (MD) coordinates. More...

#include <MDTransfFactory.h>

Inheritance diagram for Mantid::MDAlgorithms::MDTransfFactoryImpl:
Mantid::Kernel::DynamicFactory< MDTransfInterface >

Public Member Functions

std::shared_ptr< MDTransfInterfacecreate (const std::string &className) const override
 Returns an instance of the class with the given name. More...
 
 MDTransfFactoryImpl (const MDTransfFactoryImpl &)=delete
 
MDTransfFactoryImploperator= (const MDTransfFactoryImpl &)=delete
 
- Public Member Functions inherited from Mantid::Kernel::DynamicFactory< MDTransfInterface >
virtual std::shared_ptr< MDTransfInterface > create (const std::string &className) const
 Creates a new instance of the class with the given name. More...
 
virtual MDTransfInterface * createUnwrapped (const std::string &className) const
 Creates a new instance of the class with the given name, which is not wrapped in a boost shared_ptr. More...
 
void disableNotifications ()
 Disable notifications. More...
 
 DynamicFactory (const DynamicFactory &)=delete
 
void enableNotifications ()
 Enable notifications. More...
 
bool exists (const std::string &className) const
 Returns true if the given class is currently registered. More...
 
virtual const std::vector< std::string > getKeys () const
 Returns the keys in the map. More...
 
DynamicFactoryoperator= (const DynamicFactory &)=delete
 
void subscribe (const std::string &className)
 Registers the instantiator for the given class with the DynamicFactory. More...
 
void subscribe (const std::string &className, std::unique_ptr< AbstractFactory > pAbstractFactory, SubscribeAction replace=ErrorIfExists)
 Registers the instantiator for the given class with the DynamicFactory. More...
 
void unsubscribe (const std::string &className)
 Unregisters the given class and deletes the instantiator for the class. More...
 
virtual ~DynamicFactory ()=default
 Destroys the DynamicFactory and deletes the instantiators for all registered classes. More...
 

Private Member Functions

 MDTransfFactoryImpl ()=default
 Private Constructor for singleton class. More...
 

Private Attributes

std::map< std::string, std::shared_ptr< MDTransfInterface > > m_createdTransf
 Stores pointers to already created unit instances, with their name as the key. More...
 

Friends

struct Kernel::CreateUsingNew< MDTransfFactoryImpl >
 

Additional Inherited Members

- Public Types inherited from Mantid::Kernel::DynamicFactory< MDTransfInterface >
using AbstractFactory = AbstractInstantiator< MDTransfInterface >
 A typedef for the instantiator. More...
 
enum  NotificationStatus
 Defines the whether notifications are dispatched. More...
 
enum  SubscribeAction
 Defines replacement behaviour. More...
 
- Public Attributes inherited from Mantid::Kernel::DynamicFactory< MDTransfInterface >
Poco::NotificationCenter notificationCenter
 Sends notifications to observers. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DynamicFactory< MDTransfInterface >
 DynamicFactory ()
 Protected constructor for base class. More...
 

Detailed Description

Creates instances of concrete transformations into multidimensional (MD) coordinates.

See http://www.mantidproject.org/Writing_custom_ConvertTo_MD_transformation for detailed description of this class place in the algorithms hierarchy.

The factory is a singleton that hands out shared pointers to the base MDTransfornation class. It overrides the base class DynamicFactory::create method so that only a single instance of a given transformation is ever created, and a pointer to that same instance is passed out each time the transformation is requested.

Date
17/05/2012

Definition at line 69 of file MDTransfFactory.h.

Constructor & Destructor Documentation

◆ MDTransfFactoryImpl() [1/2]

Mantid::MDAlgorithms::MDTransfFactoryImpl::MDTransfFactoryImpl ( const MDTransfFactoryImpl )
delete

◆ MDTransfFactoryImpl() [2/2]

Mantid::MDAlgorithms::MDTransfFactoryImpl::MDTransfFactoryImpl ( )
privatedefault

Private Constructor for singleton class.

Member Function Documentation

◆ create()

std::shared_ptr< MDTransfInterface > Mantid::MDAlgorithms::MDTransfFactoryImpl::create ( const std::string &  className) const
overridevirtual

Returns an instance of the class with the given name.

Overrides the base class method. If an instance already exists, a pointer to it is returned, otherwise a new instance is created by the DynamicFactory::create method.

Parameters
className:: The name of the class to be created
Returns
A shared pointer to the instance of the requested MDtransformation

Reimplemented from Mantid::Kernel::DynamicFactory< MDTransfInterface >.

Definition at line 18 of file MDTransfFactory.cpp.

References Mantid::Kernel::DynamicFactory< Base, Comparator >::create(), and m_createdTransf.

◆ operator=()

MDTransfFactoryImpl & Mantid::MDAlgorithms::MDTransfFactoryImpl::operator= ( const MDTransfFactoryImpl )
delete

Friends And Related Function Documentation

◆ Kernel::CreateUsingNew< MDTransfFactoryImpl >

Definition at line 77 of file MDTransfFactory.h.

Member Data Documentation

◆ m_createdTransf

std::map<std::string, std::shared_ptr<MDTransfInterface> > Mantid::MDAlgorithms::MDTransfFactoryImpl::m_createdTransf
mutableprivate

Stores pointers to already created unit instances, with their name as the key.

Definition at line 81 of file MDTransfFactory.h.

Referenced by create().


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