EMAN2
Public Member Functions | Protected Attributes | List of all members
EMAN::FactoryBase Class Referenceabstract

A class one may inherit from to ensure that the responsibilities of being incorporated into an EMAN2::Factory are met. More...

#include <emobject.h>

Inheritance diagram for EMAN::FactoryBase:
Inheritance graph
[legend]
Collaboration diagram for EMAN::FactoryBase:
Collaboration graph
[legend]

Public Member Functions

 FactoryBase ()
 
virtual ~FactoryBase ()
 
virtual string get_name () const =0
 Get the unique name of this class (especially for factory based instantiation access) More...
 
virtual string get_desc () const =0
 Get a clear, concise description of this class. More...
 
Dict get_params () const
 get a copy of the parameters of this class More...
 
void set_params (const Dict &new_params)
 Set new parameters. More...
 
void set_param (const string key, const EMObject val)
 
virtual TypeDict get_param_types () const =0
 
void insert_params (const Dict &new_params)
 Insert parameters. More...
 
Dict copy_relevant_params (const FactoryBase *const that) const
 

Protected Attributes

Dict params
 This is the dictionary the stores the parameters of the object. More...
 

Detailed Description

A class one may inherit from to ensure that the responsibilities of being incorporated into an EMAN2::Factory are met.

This class is abstract.

Author
David Woolford
Date
Feb 2008

Definition at line 892 of file emobject.h.

Constructor & Destructor Documentation

◆ FactoryBase()

EMAN::FactoryBase::FactoryBase ( )
inline

Definition at line 895 of file emobject.h.

895{}

◆ ~FactoryBase()

virtual EMAN::FactoryBase::~FactoryBase ( )
inlinevirtual

Definition at line 896 of file emobject.h.

896{};

Member Function Documentation

◆ copy_relevant_params()

Dict EMAN::FactoryBase::copy_relevant_params ( const FactoryBase *const  that) const
inline

Definition at line 946 of file emobject.h.

947 {
948 return params.copy_keys_in(that->get_param_types());
949 }
Dict copy_keys_in(const TypeDict &tdict) const
Definition: emobject.h:599
Dict params
This is the dictionary the stores the parameters of the object.
Definition: emobject.h:953

References EMAN::Dict::copy_keys_in(), get_param_types(), and params.

Referenced by EMAN::OptimumOrientationGenerator::gen_orientations().

◆ get_desc()

virtual string EMAN::FactoryBase::get_desc ( ) const
pure virtual

◆ get_name()

virtual string EMAN::FactoryBase::get_name ( ) const
pure virtual

◆ get_param_types()

virtual TypeDict EMAN::FactoryBase::get_param_types ( ) const
pure virtual

◆ get_params()

Dict EMAN::FactoryBase::get_params ( ) const
inline

get a copy of the parameters of this class

Returns
a copy of the parameters of this class

Definition at line 911 of file emobject.h.

911{ return params; }

References params.

Referenced by EMAN::SaffOrientationGenerator::gen_orientations(), and EMAN::SaffOrientationGenerator::get_orientations_tally().

◆ insert_params()

void EMAN::FactoryBase::insert_params ( const Dict new_params)
inline

Insert parameters.

Previously present parameters are replaced, new ones are inserted.

Parameters
new_paramsthe parameters to insert

Definition at line 931 of file emobject.h.

932 {
933 // this is really inserting OR individually replacing...
934 // the old data will be kept if it is not written over
935 TypeDict permissable_params = get_param_types();
936 for (auto it = new_params.begin(); it != new_params.end(); ++it )
937 {
938 if ( !permissable_params.find_type(it->first) )
939 {
940 throw InvalidParameterException(it->first);
941 }
942 params[it->first] = it->second;
943 }
944 }
virtual TypeDict get_param_types() const =0
#define InvalidParameterException(desc)
Definition: exception.h:361

References EMAN::Dict::begin(), EMAN::Dict::end(), EMAN::TypeDict::find_type(), get_param_types(), InvalidParameterException, and params.

Referenced by set_params().

◆ set_param()

void EMAN::FactoryBase::set_param ( const string  key,
const EMObject  val 
)
inline

Definition at line 922 of file emobject.h.

922{ params[key]=val; }

References params.

◆ set_params()

void EMAN::FactoryBase::set_params ( const Dict new_params)
inline

Set new parameters.

Old parameters are cleared

Parameters
new_paramsthe new parameters

Definition at line 916 of file emobject.h.

917 {
918 params.clear();
919 insert_params(new_params);
920 }
void clear()
Clear all keys wraps map.clear()
Definition: emobject.h:560
void insert_params(const Dict &new_params)
Insert parameters.
Definition: emobject.h:931

References EMAN::Dict::clear(), insert_params(), and params.

Referenced by EMAN::OptimumOrientationGenerator::gen_orientations().

Member Data Documentation

◆ params

Dict EMAN::FactoryBase::params
mutableprotected

This is the dictionary the stores the parameters of the object.

Definition at line 953 of file emobject.h.

Referenced by EMAN::OrientationGenerator::add_orientation(), EMAN::nn4Reconstructor::buildFFTVolume(), EMAN::nn4_rectReconstructor::buildFFTVolume(), EMAN::nnSSNR_Reconstructor::buildFFTVolume(), EMAN::nn4_ctfReconstructor::buildFFTVolume(), EMAN::nn4_ctfwReconstructor::buildFFTVolume(), EMAN::nn4_ctfwsReconstructor::buildFFTVolume(), EMAN::nn4_ctf_rectReconstructor::buildFFTVolume(), EMAN::nnSSNR_ctfReconstructor::buildFFTVolume(), EMAN::nnSSNR_Reconstructor::buildNorm2Volume(), EMAN::nnSSNR_ctfReconstructor::buildNorm2Volume(), EMAN::nnSSNR_ctfReconstructor::buildNorm3Volume(), EMAN::nn4Reconstructor::buildNormVolume(), EMAN::nn4_rectReconstructor::buildNormVolume(), EMAN::nnSSNR_Reconstructor::buildNormVolume(), EMAN::nn4_ctfReconstructor::buildNormVolume(), EMAN::nn4_ctfwReconstructor::buildNormVolume(), EMAN::nn4_ctfwsReconstructor::buildNormVolume(), EMAN::nn4_ctf_rectReconstructor::buildNormVolume(), EMAN::nnSSNR_ctfReconstructor::buildNormVolume(), copy_relevant_params(), EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::finish(), EMAN::WienerFourierReconstructor::finish(), EMAN::FourierIterReconstructor::finish(), EMAN::BackProjectionReconstructor::finish(), EMAN::RealMedianReconstructor::finish(), EMAN::nnSSNR_Reconstructor::finish(), EMAN::nnSSNR_ctfReconstructor::finish(), EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::SingleOrientationGenerator::gen_orientations(), EMAN::RandomOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::OptimumOrientationGenerator::gen_orientations(), EMAN::CSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_points(), EMAN::HSym::get_asym_unit_points(), EMAN::CSym::get_asym_unit_triangles(), EMAN::DSym::get_asym_unit_triangles(), EMAN::CSym::get_delimiters(), EMAN::DSym::get_delimiters(), EMAN::HSym::get_delimiters(), EMAN::CSym::get_max_csym(), EMAN::DSym::get_max_csym(), EMAN::HSym::get_max_csym(), EMAN::CSym::get_nsym(), EMAN::DSym::get_nsym(), EMAN::HSym::get_nsym(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), EMAN::SaffOrientationGenerator::get_orientations_tally(), EMAN::OptimumOrientationGenerator::get_orientations_tally(), get_params(), EMAN::CSym::get_sym(), EMAN::DSym::get_sym(), EMAN::HSym::get_sym(), EMAN::FourierPixelInserter3D::init(), insert_params(), EMAN::FourierReconstructor::insert_slice(), EMAN::FourierIterReconstructor::insert_slice(), EMAN::nn4_ctfReconstructor::insert_slice(), EMAN::nn4_ctfwReconstructor::insert_slice(), EMAN::nn4_ctfwsReconstructor::insert_slice(), EMAN::CSym::is_in_asym_unit(), EMAN::DSym::is_in_asym_unit(), EMAN::HSym::is_in_asym_unit(), EMAN::BackProjectionReconstructor::load_default_settings(), EMAN::FourierReconstructor::load_inserter(), EMAN::Reconstructor::operator[](), EMAN::Reconstructor::print_params(), set_param(), set_params(), EMAN::FourierReconstructorSimple2D::setup(), EMAN::FourierReconstructor::setup(), EMAN::FourierIterReconstructor::setup(), EMAN::BackProjectionReconstructor::setup(), EMAN::RealMedianReconstructor::setup(), EMAN::nn4Reconstructor::setup(), EMAN::nn4_rectReconstructor::setup(), EMAN::nnSSNR_Reconstructor::setup(), EMAN::nn4_ctfReconstructor::setup(), EMAN::nn4_ctfwReconstructor::setup(), EMAN::nn4_ctfwsReconstructor::setup(), EMAN::nn4_ctf_rectReconstructor::setup(), EMAN::nnSSNR_ctfReconstructor::setup(), EMAN::FourierReconstructor::setup_seed(), and EMAN::FourierReconstructor::setup_seedandweights().


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