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

A factory for symmetry operations. More...

#include <SymmetryOperationFactory.h>

Public Member Functions

SymmetryOperation createSymOp (const std::string &identifier)
 Creates a SymmetryOperation object from its identifier. More...
 
std::vector< SymmetryOperationcreateSymOps (const std::string &identifiers)
 Creates all symmetry operations in string (separated by semicolon). More...
 
std::vector< SymmetryOperationcreateSymOps (const std::vector< std::string > &identifiers)
 Creates all symmetry operations with the given strings (whitespaces at beginning and end are removed). More...
 
bool isSubscribed (const std::string &identifier) const
 Returns true if identifier already has a prototype in the factory. More...
 
std::vector< std::string > subscribedSymbols () const
 Returns all symbols in the factory. More...
 
void subscribeSymOp (const std::string &identifier)
 Subscribes a symmetry operation into the factory. More...
 
void unsubscribeSymOp (const std::string &identifier)
 Unsubscribes a symmetry operation from the factory. More...
 

Protected Member Functions

void subscribe (const std::string &alias, const SymmetryOperation &prototype)
 Subscribes symmetry operation into factory, using the supplied alias as key. More...
 

Protected Attributes

std::map< std::string, SymmetryOperationm_prototypes
 

Private Member Functions

 SymmetryOperationFactoryImpl ()
 Private default constructor. More...
 

Friends

struct Mantid::Kernel::CreateUsingNew< SymmetryOperationFactoryImpl >
 

Detailed Description

A factory for symmetry operations.

Symmetry operations are stored with respect to their identifier (see SymmetryOperation for details).

Creation of symmetry operations is then performed like this:

SymmetryOperations inversion =
    SymmetryOperationFactory::Instance().createSymOp("x,y,z");

Creating a symmetry operation object automatically registers the object as a prototype and subsequent creations are much more efficient because the symbol does not need to be parsed.

Available symmetry operations may be queried with SymmetryOperation::subscribedSymbols.

Author
Michael Wedel, Paul Scherrer Institut - SINQ
Date
10/09/2014

Definition at line 41 of file SymmetryOperationFactory.h.

Constructor & Destructor Documentation

◆ SymmetryOperationFactoryImpl()

Mantid::Geometry::SymmetryOperationFactoryImpl::SymmetryOperationFactoryImpl ( )
private

Private default constructor.

Definition at line 80 of file SymmetryOperationFactory.cpp.

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

Member Function Documentation

◆ createSymOp()

SymmetryOperation Mantid::Geometry::SymmetryOperationFactoryImpl::createSymOp ( const std::string &  identifier)

Creates a SymmetryOperation object from its identifier.

Definition at line 18 of file SymmetryOperationFactory.cpp.

References isSubscribed(), m_prototypes, and subscribeSymOp().

Referenced by export_SymmetryOperationFactory().

◆ createSymOps() [1/2]

std::vector< SymmetryOperation > Mantid::Geometry::SymmetryOperationFactoryImpl::createSymOps ( const std::string &  identifiers)

Creates all symmetry operations in string (separated by semicolon).

Definition at line 27 of file SymmetryOperationFactory.cpp.

References createSymOps().

Referenced by createSymOps().

◆ createSymOps() [2/2]

std::vector< SymmetryOperation > Mantid::Geometry::SymmetryOperationFactoryImpl::createSymOps ( const std::vector< std::string > &  identifiers)

Creates all symmetry operations with the given strings (whitespaces at beginning and end are removed).

Definition at line 36 of file SymmetryOperationFactory.cpp.

◆ isSubscribed()

bool Mantid::Geometry::SymmetryOperationFactoryImpl::isSubscribed ( const std::string &  identifier) const

Returns true if identifier already has a prototype in the factory.

Definition at line 59 of file SymmetryOperationFactory.cpp.

References m_prototypes.

Referenced by createSymOp(), export_SymmetryOperationFactory(), subscribe(), and unsubscribeSymOp().

◆ subscribe()

void Mantid::Geometry::SymmetryOperationFactoryImpl::subscribe ( const std::string &  alias,
const SymmetryOperation prototype 
)
protected

Subscribes symmetry operation into factory, using the supplied alias as key.

Definition at line 73 of file SymmetryOperationFactory.cpp.

References isSubscribed(), and m_prototypes.

Referenced by subscribeSymOp().

◆ subscribedSymbols()

std::vector< std::string > Mantid::Geometry::SymmetryOperationFactoryImpl::subscribedSymbols ( ) const

Returns all symbols in the factory.

Definition at line 64 of file SymmetryOperationFactory.cpp.

References m_prototypes.

Referenced by export_SymmetryOperationFactory().

◆ subscribeSymOp()

void Mantid::Geometry::SymmetryOperationFactoryImpl::subscribeSymOp ( const std::string &  identifier)

Subscribes a symmetry operation into the factory.

Definition at line 45 of file SymmetryOperationFactory.cpp.

References subscribe().

Referenced by createSymOp().

◆ unsubscribeSymOp()

void Mantid::Geometry::SymmetryOperationFactoryImpl::unsubscribeSymOp ( const std::string &  identifier)

Unsubscribes a symmetry operation from the factory.

Definition at line 52 of file SymmetryOperationFactory.cpp.

References isSubscribed(), and m_prototypes.

Friends And Related Function Documentation

◆ Mantid::Kernel::CreateUsingNew< SymmetryOperationFactoryImpl >

Definition at line 57 of file SymmetryOperationFactory.h.

Member Data Documentation

◆ m_prototypes

std::map<std::string, SymmetryOperation> Mantid::Geometry::SymmetryOperationFactoryImpl::m_prototypes
protected

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