EMAN2
|
Factory is used to store objects to create new instances. More...
#include <emobject.h>
Public Types | |
typedef T *(* | InstanceType) () |
Public Member Functions | |
Symmetry3D * | get (const string &instancename) |
A template specialization for get - so people can call get with strings like "c1","d4" etc - this avoids have to use Dicts to specify the nsym. More... | |
Static Public Member Functions | |
template<class ClassType > | |
static void | add () |
static T * | get (const string &instance_name) |
static T * | get (const string &instance_name, const Dict ¶ms) |
static vector< string > | get_list () |
Private Member Functions | |
Factory () | |
Factory (const Factory< T > &) | |
~Factory () | |
template<class ClassType > | |
void | force_add () |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
Factory () | |
A template specialization for the Symmetry3D factory. Adds all of the symmetries. More... | |
Factory () | |
Template specialization for the OrientationGenerator class. More... | |
Static Private Member Functions | |
static void | init () |
Private Attributes | |
map< string, InstanceType > | my_dict |
Static Private Attributes | |
static Factory< T > * | my_instance = 0 |
Factory is used to store objects to create new instances.
It is a singleton template. Typical usages are as follows:
How to define a new factory (e.g. Processor Factory):
template<> Factory<Processor>::Factory() { force_add(&AbsoluateValueProcessor::NEW); force_add(&BooleanProcessor::NEW); }
How to use a Factory (e.g. Processor Factory):
Processor *f1 = Factory<Processor>::get("math.absvalue"); Processor *f2 = Factory<Processor>::get("filter.lowpass.gauss", Dict("cufoff_freq", EMObject(12));
Definition at line 724 of file emobject.h.
typedef T *(* EMAN::Factory< T >::InstanceType) () |
Definition at line 727 of file emobject.h.
|
private |
|
private |
|
private |
|
private |
|
private |
Definition at line 55 of file analyzer.cpp.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
A template specialization for the Symmetry3D factory. Adds all of the symmetries.
|
private |
Template specialization for the OrientationGenerator class.
Definition at line 767 of file emobject.h.
Definition at line 758 of file emobject.h.
|
static |
Definition at line 781 of file emobject.h.
References NotExistingObjectException.
Referenced by EMAN::dump_factory(), EMAN::dump_factory_list(), EMAN::BackProjectionReconstructor::finish(), EMAN::RealMedianReconstructor::finish(), EMAN::Transform::get_nsym(), EMAN::Transform::get_sym(), EMAN::Transform::get_sym_proj(), EMAN::Symmetry3D::get_symmetries(), EMAN::group_processors(), EMAN::FourierReconstructor::load_inserter(), EMAN::ApplySymProcessor::process(), EMAN::AutoMaskAsymUnit::process_inplace(), EMAN::SegmentSubunitProcessor::process_inplace(), EMAN::RT3DSphereAligner::xform_align_nbest(), EMAN::RT2Dto3DTreeAligner::xform_align_nbest(), EMAN::RT3DTreeAligner::xform_align_nbest(), and EMAN::RT3DLocalTreeAligner::xform_align_nbest().
|
static |
Definition at line 802 of file emobject.h.
References InvalidParameterException, EMAN::Dict::keys(), and NotExistingObjectException.
Symmetry3D * EMAN::Factory< Symmetry3D >::get | ( | const string & | instancename | ) |
A template specialization for get - so people can call get with strings like "c1","d4" etc - this avoids have to use Dicts to specify the nsym.
|
static |
Definition at line 837 of file emobject.h.
Referenced by EMAN::dump_factory(), EMAN::dump_factory_list(), and EMAN::group_processors().
|
staticprivate |
Definition at line 749 of file emobject.h.
|
private |
Definition at line 742 of file emobject.h.
|
staticprivate |
Definition at line 741 of file emobject.h.