Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
Mantid::Geometry::BraggScattererFactoryImpl Class Reference

#include <BraggScattererFactory.h>

Inheritance diagram for Mantid::Geometry::BraggScattererFactoryImpl:
Mantid::Kernel::DynamicFactory< BraggScatterer >

Public Member Functions

BraggScatterer_sptr createScatterer (const std::string &name, const std::string &properties="") const
 Creates an initialized instance of the desired scatterer class. More...
 
template<class C >
void subscribeScatterer ()
 Subscribes a scatterer class into the factory. More...
 
- Public Member Functions inherited from Mantid::Kernel::DynamicFactory< BraggScatterer >
virtual std::shared_ptr< BraggScatterercreate (const std::string &className) const
 Creates a new instance of the class with the given name. More...
 
virtual BraggScatterercreateUnwrapped (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

 BraggScattererFactoryImpl ()
 Private constructor. More...
 

Friends

struct Mantid::Kernel::CreateUsingNew< BraggScattererFactoryImpl >
 

Additional Inherited Members

- Public Types inherited from Mantid::Kernel::DynamicFactory< BraggScatterer >
using AbstractFactory = AbstractInstantiator< BraggScatterer >
 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< BraggScatterer >
Poco::NotificationCenter notificationCenter
 Sends notifications to observers. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DynamicFactory< BraggScatterer >
 DynamicFactory ()
 Protected constructor for base class. More...
 

Detailed Description

Definition at line 53 of file BraggScattererFactory.h.

Constructor & Destructor Documentation

◆ BraggScattererFactoryImpl()

Mantid::Geometry::BraggScattererFactoryImpl::BraggScattererFactoryImpl ( )
private

Private constructor.

Definition at line 40 of file BraggScattererFactory.cpp.

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

Member Function Documentation

◆ createScatterer()

BraggScatterer_sptr Mantid::Geometry::BraggScattererFactoryImpl::createScatterer ( const std::string &  name,
const std::string &  properties = "" 
) const

Creates an initialized instance of the desired scatterer class.

This method tries to construct an instance of the class specified by the "name"-parameter. If it is not found, an exception is thrown (see DynamicFactory::create). Otherwise, the object is initialized. If the second argument is not empty, it is expected to contain a semi-colon separated list of "name=value"-pairs. These pairs need to be valid input for assigning properties of the created scatterer. See the example in the general class documentation.

Parameters
name:: Class name to construct.
properties:: Semi-colon separated "name=value"-pairs.
Returns
Initialized scatterer object.

Definition at line 27 of file BraggScattererFactory.cpp.

References Mantid::Kernel::DynamicFactory< BraggScatterer >::create().

◆ subscribeScatterer()

template<class C >
void Mantid::Geometry::BraggScattererFactoryImpl::subscribeScatterer ( )
inline

Subscribes a scatterer class into the factory.

Definition at line 58 of file BraggScattererFactory.h.

Friends And Related Function Documentation

◆ Mantid::Kernel::CreateUsingNew< BraggScattererFactoryImpl >

Definition at line 58 of file BraggScattererFactory.h.


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