EMAN2
Public Member Functions | Protected Attributes
EMAN::FactoryBase Class Reference

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]

List of all members.

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)
virtual string get_desc () const =0
 Get a clear, concise description of this class.
Dict get_params () const
 get a copy of the parameters of this class
void set_params (const Dict &new_params)
 Set new parameters.
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.
Dict copy_relevant_params (const FactoryBase *const that) const

Protected Attributes

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

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 893 of file emobject.h.


Constructor & Destructor Documentation

EMAN::FactoryBase::FactoryBase ( ) [inline]

Definition at line 896 of file emobject.h.

{}
virtual EMAN::FactoryBase::~FactoryBase ( ) [inline, virtual]

Definition at line 897 of file emobject.h.

{};

Member Function Documentation

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

Definition at line 948 of file emobject.h.

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

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

                {
                        return params.copy_keys_in(that->get_param_types());

                }
virtual string EMAN::FactoryBase::get_desc ( ) const [pure virtual]
virtual string EMAN::FactoryBase::get_name ( ) const [pure virtual]
virtual TypeDict EMAN::FactoryBase::get_param_types ( ) const [pure virtual]
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 912 of file emobject.h.

References params.

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

{ return 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 932 of file emobject.h.

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

Referenced by set_params().

                {
                // this is really inserting OR individually replacing...
                // the old data will be kept if it is not written over
                        TypeDict permissable_params = get_param_types();
                        for ( Dict::const_iterator it = new_params.begin(); it != new_params.end(); ++it )
                        {

                                if ( !permissable_params.find_type(it->first) )
                                {
                                        throw InvalidParameterException(it->first);
                                }
                                params[it->first] = it->second;
                        }
                }
void EMAN::FactoryBase::set_param ( const string  key,
const EMObject  val 
) [inline]

Definition at line 923 of file emobject.h.

References key, and params.

{ params[key]=val; }
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 917 of file emobject.h.

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

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

                {
                        params.clear();
                        insert_params(new_params);
                }

Member Data Documentation

Dict EMAN::FactoryBase::params [mutable, protected]

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

Definition at line 956 of file emobject.h.

Referenced by EMAN::OrientationGenerator::add_orientation(), EMAN::nnSSNR_ctfReconstructor::buildFFTVolume(), EMAN::nn4_ctf_rectReconstructor::buildFFTVolume(), EMAN::nn4_ctfwReconstructor::buildFFTVolume(), EMAN::nn4_ctfReconstructor::buildFFTVolume(), EMAN::nnSSNR_Reconstructor::buildFFTVolume(), EMAN::nn4_rectReconstructor::buildFFTVolume(), EMAN::nn4Reconstructor::buildFFTVolume(), EMAN::nnSSNR_ctfReconstructor::buildNorm2Volume(), EMAN::nnSSNR_Reconstructor::buildNorm2Volume(), EMAN::nnSSNR_ctfReconstructor::buildNorm3Volume(), EMAN::nnSSNR_ctfReconstructor::buildNormVolume(), EMAN::nn4_ctf_rectReconstructor::buildNormVolume(), EMAN::nn4_ctfwReconstructor::buildNormVolume(), EMAN::nn4_ctfReconstructor::buildNormVolume(), EMAN::nnSSNR_Reconstructor::buildNormVolume(), EMAN::nn4_rectReconstructor::buildNormVolume(), EMAN::nn4Reconstructor::buildNormVolume(), copy_relevant_params(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::do_insert_slice_work(), EMAN::nnSSNR_ctfReconstructor::finish(), EMAN::nnSSNR_Reconstructor::finish(), EMAN::BackProjectionReconstructor::finish(), EMAN::WienerFourierReconstructor::finish(), EMAN::FourierReconstructor::finish(), EMAN::OptimumOrientationGenerator::gen_orientations(), EMAN::SaffOrientationGenerator::gen_orientations(), EMAN::EvenOrientationGenerator::gen_orientations(), EMAN::RandomOrientationGenerator::gen_orientations(), EMAN::EmanOrientationGenerator::gen_orientations(), EMAN::HSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_points(), EMAN::CSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_triangles(), EMAN::CSym::get_asym_unit_triangles(), EMAN::HSym::get_delimiters(), EMAN::DSym::get_delimiters(), EMAN::CSym::get_delimiters(), EMAN::HSym::get_max_csym(), EMAN::DSym::get_max_csym(), EMAN::CSym::get_max_csym(), EMAN::HSym::get_nsym(), EMAN::DSym::get_nsym(), EMAN::CSym::get_nsym(), EMAN::OptimumOrientationGenerator::get_orientations_tally(), EMAN::SaffOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), EMAN::EmanOrientationGenerator::get_orientations_tally(), get_params(), EMAN::HSym::get_sym(), EMAN::DSym::get_sym(), EMAN::CSym::get_sym(), EMAN::FourierPixelInserter3D::init(), insert_params(), EMAN::HSym::is_in_asym_unit(), EMAN::DSym::is_in_asym_unit(), EMAN::CSym::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::nnSSNR_ctfReconstructor::setup(), EMAN::nn4_ctf_rectReconstructor::setup(), EMAN::nn4_ctfwReconstructor::setup(), EMAN::nn4_ctfReconstructor::setup(), EMAN::nnSSNR_Reconstructor::setup(), EMAN::nn4_rectReconstructor::setup(), EMAN::nn4Reconstructor::setup(), EMAN::BackProjectionReconstructor::setup(), EMAN::FourierReconstructor::setup(), EMAN::FourierReconstructorSimple2D::setup(), and EMAN::FourierReconstructor::setup_seed().


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