Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

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


Constructor & Destructor Documentation

EMAN::FactoryBase::FactoryBase  )  [inline]
 

Definition at line 881 of file emobject.h.

00881 {}

virtual EMAN::FactoryBase::~FactoryBase  )  [inline, virtual]
 

Definition at line 882 of file emobject.h.

00882 {};


Member Function Documentation

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

Definition at line 933 of file emobject.h.

References get_param_types().

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

00934                 {
00935                         return params.copy_keys_in(that->get_param_types());
00936 
00937                 }

virtual string EMAN::FactoryBase::get_desc  )  const [pure virtual]
 

Get a clear, concise description of this class.

Returns:
a clear, concise description of this class

Implemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctf_rectReconstructor, EMAN::nnSSNR_ctfReconstructor, EMAN::FourierInserter3DMode1, EMAN::FourierInserter3DMode2, EMAN::FourierInserter3DMode3, EMAN::FourierInserter3DMode5, EMAN::FourierInserter3DMode6, EMAN::FourierInserter3DMode7, EMAN::FourierInserter3DMode8, EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::TetrahedralSym, EMAN::OctahedralSym, EMAN::IcosahedralSym, EMAN::Icosahedral2Sym, EMAN::EmanOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.

virtual string EMAN::FactoryBase::get_name  )  const [pure virtual]
 

Get the unique name of this class (especially for factory based instantiation access).

Returns:
the unique name of this class

Implemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::WienerFourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctf_rectReconstructor, EMAN::nnSSNR_ctfReconstructor, EMAN::FourierInserter3DMode1, EMAN::FourierInserter3DMode2, EMAN::FourierInserter3DMode3, EMAN::FourierInserter3DMode5, EMAN::FourierInserter3DMode6, EMAN::FourierInserter3DMode7, EMAN::FourierInserter3DMode8, EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::TetrahedralSym, EMAN::OctahedralSym, EMAN::IcosahedralSym, EMAN::Icosahedral2Sym, EMAN::EmanOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.

Referenced by EMAN::PlatonicSym::get_delimiters().

virtual TypeDict EMAN::FactoryBase::get_param_types  )  const [pure virtual]
 

Returns:
a TypeDict defining and describing the feasible parameters of this class

Implemented in EMAN::XYZReconstructor, EMAN::FourierReconstructorSimple2D, EMAN::FourierReconstructor, EMAN::FourierPlaneReconstructor, EMAN::BackProjectionReconstructor, EMAN::nn4Reconstructor, EMAN::nn4_rectReconstructor, EMAN::nnSSNR_Reconstructor, EMAN::nn4_ctfReconstructor, EMAN::nn4_ctf_rectReconstructor, EMAN::nnSSNR_ctfReconstructor, EMAN::FourierPixelInserter3D, EMAN::CSym, EMAN::DSym, EMAN::HSym, EMAN::PlatonicSym, EMAN::OrientationGenerator, EMAN::EmanOrientationGenerator, EMAN::RandomOrientationGenerator, EMAN::EvenOrientationGenerator, EMAN::SaffOrientationGenerator, and EMAN::OptimumOrientationGenerator.

Referenced by copy_relevant_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 897 of file emobject.h.

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

00897 { 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_params the parameters to insert

Definition at line 917 of file emobject.h.

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

00918                 {
00919                 // this is really inserting OR individually replacing...
00920                 // the old data will be kept if it is not written over
00921                         TypeDict permissable_params = get_param_types();
00922                         for ( Dict::const_iterator it = new_params.begin(); it != new_params.end(); ++it )
00923                         {
00924 
00925                                 if ( !permissable_params.find_type(it->first) )
00926                                 {
00927                                         throw InvalidParameterException(it->first);
00928                                 }
00929                                 params[it->first] = it->second;
00930                         }
00931                 }

void EMAN::FactoryBase::set_param const string  key,
const EMObject  val
[inline]
 

Definition at line 908 of file emobject.h.

00908 { params[key]=val; }

void EMAN::FactoryBase::set_params const Dict new_params  )  [inline]
 

Set new parameters.

Old parameters are cleared

Parameters:
new_params the new parameters

Definition at line 902 of file emobject.h.

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

00903                 {
00904                         params.clear();
00905                         insert_params(new_params);
00906                 }


Member Data Documentation

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

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

Definition at line 941 of file emobject.h.


The documentation for this class was generated from the following file:
Generated on Tue Jun 11 13:42:01 2013 for EMAN2 by  doxygen 1.3.9.1