Mantid
|
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< SymmetryOperation > | createSymOps (const std::string &identifiers) |
Creates all symmetry operations in string (separated by semicolon). More... | |
std::vector< SymmetryOperation > | createSymOps (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, SymmetryOperation > | m_prototypes |
Private Member Functions | |
SymmetryOperationFactoryImpl () | |
Private default constructor. More... | |
Friends | |
struct | Mantid::Kernel::CreateUsingNew< SymmetryOperationFactoryImpl > |
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.
Definition at line 41 of file SymmetryOperationFactory.h.
|
private |
Private default constructor.
Definition at line 80 of file SymmetryOperationFactory.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance().
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().
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().
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.
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().
|
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().
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().
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().
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.
|
friend |
Definition at line 57 of file SymmetryOperationFactory.h.
|
protected |
Definition at line 57 of file SymmetryOperationFactory.h.
Referenced by createSymOp(), isSubscribed(), subscribe(), subscribedSymbols(), and unsubscribeSymOp().