EMAN2
Classes | Public Member Functions | Private Attributes | Friends
EMAN::Dict Class Reference

Dict is a dictionary to store <string, EMObject> pair. More...

#include <emobject.h>

Collaboration diagram for EMAN::Dict:
Collaboration graph
[legend]

List of all members.

Classes

class  const_iterator
 Const iterator support for the Dict object This is just a wrapper, everything is inherited from the map<string,EMObject>::cons_iterator so the interface is the same as you would expect i.e for ( Dict::const_iterator it = params.begin(); it != params.end(); ++it ) More...
class  iterator
 Non const iterator support for the Dict object This is just a wrapper, everything is inherited from the map<string,EMObject>::iterator so the interface is the same as you would expect i.e for ( Dict::iterator it = params.begin(); it != params.end(); ++it ) More...

Public Member Functions

 Dict ()
 Dict (const string &key1, EMObject val1)
 Construct a Dict object from 1 key/value pair It's probably more conventional to intialize key/value pairs using operator[], but either approach is fine.
 Dict (const string &key1, EMObject val1, const string &key2, EMObject val2)
 Construct a Dict object from 2 key/value pairs.
 Dict (const string &key1, EMObject val1, const string &key2, EMObject val2, const string &key3, EMObject val3)
 Construct a Dict object from 3 key/value pairs.
 Dict (const string &key1, EMObject val1, const string &key2, EMObject val2, const string &key3, EMObject val3, const string &key4, EMObject val4)
 Construct a Dict object from 4 key/value pairs.
 Dict (const string &key1, EMObject val1, const string &key2, EMObject val2, const string &key3, EMObject val3, const string &key4, EMObject val4, const string &key5, EMObject val5)
 Construct a Dict object from 5 key/value pairs.
 Dict (const map< string, EMObject > &d)
 Construct a Dict object from a map object Calls the generic algorithm "copy".
 ~Dict ()
 Destructor Performs no explicit action besides what the compiler automatically does.
 Dict (const Dict &that)
 Copy constructor Copies all elements in dict.
Dictoperator= (const Dict &that)
 Assignment operator Copies all elements in dict.
vector< string > keys () const
 Get a vector containing all of the (string) keys in this dictionary.
vector< EMObjectvalues () const
 Get a vector containing copies of each of the EMObjects in this dictionary.
bool has_key_ci (const string &key) const
 Ask the Dictionary if it as a particular key in a case insensitive way.
bool has_key (const string &key) const
 Ask the Dictionary if it as a particular key.
size_t size () const
 Ask the Dictionary for its size.
EMObject get (const string &key) const
 Get the EMObject corresponding to the particular key Probably better to just use operator[].
EMObject get_ci (const string &key) const
 Get the EMObject corresponding to the particular key using case insensitivity.
void put (const string &key, EMObject val)
 Put the value/key pair into the dictionary probably better to just use operator[].
void erase (const string &key)
 Remove a particular key.
void clear ()
 Clear all keys wraps map.clear()
template<typename type >
type set_default (const string &key, type val)
 Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there was a function being written for every type)
Dict copy_exclude_keys (const vector< string > &excluded_keys) const
Dict copy_exclusive_keys (const vector< string > &exclusive_keys) const
Dict copy_keys_in (const TypeDict &tdict) const
EMObjectoperator[] (const string &key)
EMObject operator[] (const string &key) const
iterator begin (void)
const_iterator begin (void) const
iterator end (void)
const_iterator end (void) const
iterator find (const string &key)
const_iterator find (const string &key) const

Private Attributes

map< string, EMObjectdict

Friends

bool operator== (const Dict &d1, const Dict &d2)
 Friend declaration operator== namespace EMAN2 operator== accesses private variables.
bool operator!= (const Dict &d1, const Dict &d2)
 Friend declaration operator!= namespace EMAN2 operator!= accesses private variables.

Detailed Description

Dict is a dictionary to store <string, EMObject> pair.

Typical ways to construct a Dict:

Dict d; d["lowpass"] = 12.23; float lowpass1 = d["lowpass"];

Dict d2("lowpass", 12.23);

You can iterate through a dict: for ( Dict::const_iterator it = params.begin(); it != params.end(); ++it ) { //do things to it } And similary use the Dict iterator as arguments to the generic algorithms that are feasible, such as copy.

You can find things in the iterator style: if( d.find("lowpass") != d.end() ) cout << "D has a lowpass key" << endl;\ Or like this if( d.has_key("lowpass") ) ...

A Dict has copy and assignment operators.

See the testing code in rt/emdata/test_emobject.cpp for prewritten testing code

Definition at line 389 of file emobject.h.


Constructor & Destructor Documentation

EMAN::Dict::Dict ( ) [inline]

Definition at line 392 of file emobject.h.

                {
                }
EMAN::Dict::Dict ( const string &  key1,
EMObject  val1 
) [inline]

Construct a Dict object from 1 key/value pair It's probably more conventional to intialize key/value pairs using operator[], but either approach is fine.

Definition at line 400 of file emobject.h.

References dict.

                {
                        dict[key1] = val1;
                }
EMAN::Dict::Dict ( const string &  key1,
EMObject  val1,
const string &  key2,
EMObject  val2 
) [inline]

Construct a Dict object from 2 key/value pairs.

Definition at line 407 of file emobject.h.

References dict.

                {
                        dict[key1] = val1;
                        dict[key2] = val2;
                }
EMAN::Dict::Dict ( const string &  key1,
EMObject  val1,
const string &  key2,
EMObject  val2,
const string &  key3,
EMObject  val3 
) [inline]

Construct a Dict object from 3 key/value pairs.

Definition at line 416 of file emobject.h.

References dict.

                {
                        dict[key1] = val1;
                        dict[key2] = val2;
                        dict[key3] = val3;
                }
EMAN::Dict::Dict ( const string &  key1,
EMObject  val1,
const string &  key2,
EMObject  val2,
const string &  key3,
EMObject  val3,
const string &  key4,
EMObject  val4 
) [inline]

Construct a Dict object from 4 key/value pairs.

Definition at line 427 of file emobject.h.

References dict.

                {
                        dict[key1] = val1;
                        dict[key2] = val2;
                        dict[key3] = val3;
                        dict[key4] = val4;
                }
EMAN::Dict::Dict ( const string &  key1,
EMObject  val1,
const string &  key2,
EMObject  val2,
const string &  key3,
EMObject  val3,
const string &  key4,
EMObject  val4,
const string &  key5,
EMObject  val5 
) [inline]

Construct a Dict object from 5 key/value pairs.

Definition at line 440 of file emobject.h.

References dict.

                {
                        dict[key1] = val1;
                        dict[key2] = val2;
                        dict[key3] = val3;
                        dict[key4] = val4;
                        dict[key5] = val5;
                }
EMAN::Dict::Dict ( const map< string, EMObject > &  d) [inline]

Construct a Dict object from a map object Calls the generic algorithm "copy".

Definition at line 456 of file emobject.h.

References copy(), and dict.

                {
                        copy(d.begin(), d.end(), inserter(dict, dict.begin()));
                        // Or use
                        // dict.insert(d.begin(), d.end());
                }
EMAN::Dict::~Dict ( ) [inline]

Destructor Performs no explicit action besides what the compiler automatically does.

Definition at line 466 of file emobject.h.

{}
Dict::Dict ( const Dict that)

Copy constructor Copies all elements in dict.

Definition at line 1070 of file emobject.cpp.

{
        *this = that;
}

Member Function Documentation

Dict::iterator Dict::begin ( void  )
Dict::const_iterator Dict::begin ( void  ) const

Definition at line 1114 of file emobject.cpp.

References dict.

{
        return const_iterator( (map < string, EMObject >::const_iterator) dict.begin() );
}
void EMAN::Dict::clear ( ) [inline]

Clear all keys wraps map.clear()

Definition at line 566 of file emobject.h.

References dict.

Referenced by EMAN::FactoryBase::set_params().

                {
                        dict.clear();
                }
Dict EMAN::Dict::copy_exclude_keys ( const vector< string > &  excluded_keys) const [inline]

Definition at line 583 of file emobject.h.

References erase(), and has_key().

                {
                        Dict ret(*this);

                        for ( vector<string>::const_iterator it = excluded_keys.begin(); it != excluded_keys.end(); ++it ) {
                                if (ret.has_key(*it)) ret.erase(*it);
                        }

                        return ret;
                }
Dict EMAN::Dict::copy_exclusive_keys ( const vector< string > &  exclusive_keys) const [inline]

Definition at line 594 of file emobject.h.

References has_key().

Referenced by copy_keys_in().

                {
                        Dict ret;
                        for ( vector<string>::const_iterator it = exclusive_keys.begin(); it != exclusive_keys.end(); ++it ) {
                                if (has_key(*it)) ret[*it] = (*this)[*it];
                        }

                        return ret;
                }
Dict EMAN::Dict::copy_keys_in ( const TypeDict tdict) const [inline]

Definition at line 604 of file emobject.h.

References copy_exclusive_keys(), EMAN::TypeDict::keys(), and keys().

Referenced by EMAN::FactoryBase::copy_relevant_params().

                                                                 {
                        vector<string> keys = tdict.keys();
                        return copy_exclusive_keys(keys);
                }
Dict::iterator Dict::end ( void  )
Dict::const_iterator Dict::end ( void  ) const

Definition at line 1130 of file emobject.cpp.

References dict.

{
        return const_iterator( (map < string, EMObject >::const_iterator)dict.end() );
}
void EMAN::Dict::erase ( const string &  key) [inline]

Remove a particular key.

Definition at line 558 of file emobject.h.

References dict.

Referenced by copy_exclude_keys(), EMAN::EMData::del_attr(), EMAN::EMData::read_binedimage(), and EMAN::EMData::read_image().

                {
                        dict.erase(key);
                }
Dict::const_iterator Dict::find ( const string &  key) const

Definition at line 1135 of file emobject.cpp.

References dict.

{
        return const_iterator( (map < string, EMObject >::const_iterator)dict.find(key) );
}
Dict::iterator Dict::find ( const string &  key)

Definition at line 1120 of file emobject.cpp.

References dict.

{
        return iterator( dict.find(key) );
}
EMObject EMAN::Dict::get ( const string &  key) const [inline]

Get the EMObject corresponding to the particular key Probably better to just use operator[].

Definition at line 533 of file emobject.h.

References dict, has_key(), key, LOGERR, and NotExistingObjectException.

Referenced by EMAN::file_store::add_image(), EMAN::MeanZeroEdgeProcessor::process_inplace(), EMAN::SigmaProcessor::set_params(), EMAN::RangeThresholdProcessor::set_params(), EMAN::ExpProcessor::set_params(), and EMAN::LinearXformProcessor::set_params().

                {
                        if( has_key(key) ) {
                                return dict[key];
                        }
                        else {
                                LOGERR("No such key exist in this Dict");
                                throw NotExistingObjectException("EMObject", "Nonexisting key (" + key + ") in Dict");
                        }
                }
EMObject Dict::get_ci ( const string &  key) const

Get the EMObject corresponding to the particular key using case insensitivity.

Parameters:
keythe key you want to check for in a case insensitive way

Definition at line 1192 of file emobject.cpp.

References dict, NotExistingObjectException, and EMAN::Util::str_to_lower().

Referenced by EMAN::Transform::set_params(), EMAN::Transform::set_params_inverse(), and EMAN::Transform::set_rotation().

{
        string lower_key = Util::str_to_lower(key);

        for (map < string, EMObject >::const_iterator it = dict.begin(); it != dict.end(); ++it ) {
                string lower = Util::str_to_lower(it->first);
                if (lower == lower_key) return it->second;
        }

        throw NotExistingObjectException("EMObject", "Nonexisting key (" + key + ") in Dict");
}
bool EMAN::Dict::has_key ( const string &  key) const [inline]

Ask the Dictionary if it as a particular key.

Parameters:
keythe (string) key to find

Definition at line 514 of file emobject.h.

References dict.

Referenced by EMAN::Refine3DAlignerGrid::align(), EMAN::Refine3DAlignerQuaternion::align(), EMAN::SymAlignProcessorQuat::align(), EMAN::RefineAlignerCG::align(), EMAN::RefineAligner::align(), EMAN::TransformProcessor::assert_valid_aspect(), EMAN::EMData::clip_inplace(), EMAN::DotCmp::cmp(), EMAN::SqEuclideanCmp::cmp(), EMAN::LodCmp::cmp(), EMAN::CccCmp::cmp(), copy_exclude_keys(), copy_exclusive_keys(), EMAN::SetSFProcessor::create_radial_func(), EMAN::WienerFourierReconstructor::finish(), EMAN::FourierReconstructor::finish(), get(), EMAN::EMData::get_attr(), EMAN::EMData::get_attr_default(), EMAN::EMData::get_clip(), EMAN::EMData::get_ctf(), EMAN::FourierPixelInserter3D::init(), EMAN::NewFourierProcessor::preprocess(), EMAN::LowpassAutoBProcessor::preprocess(), EMAN::FourierProcessor::preprocess(), EMAN::HighpassAutoPeakProcessor::preprocess(), EMAN::NewFourierProcessor::preprocessandconvertpars(), EMAN::ScaleTransformProcessor::process(), EMAN::NewLowpassGaussProcessor::process_inplace(), EMAN::BinaryOperateProcessor< Type >::process_inplace(), EMAN::ScaleTransformProcessor::process_inplace(), EMAN::FFTProcessor::process_inplace(), EMAN::TestImageCylinder::process_inplace(), EMAN::TestImageNoiseGauss::process_inplace(), EMAN::TestImageNoiseUniformRand::process_inplace(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::TestImageSquarecube::process_inplace(), EMAN::TestImageSinewave::process_inplace(), EMAN::TestImageSphericalWave::process_inplace(), EMAN::TestImageFourierNoiseProfile::process_inplace(), EMAN::CTFSNRWeightProcessor::process_inplace(), EMAN::AutoMask3D2Processor::process_inplace(), EMAN::AutoMask3DProcessor::process_inplace(), EMAN::AddRandomNoiseProcessor::process_inplace(), EMAN::AutoMask2DProcessor::process_inplace(), EMAN::AddNoiseProcessor::process_inplace(), EMAN::GradientPlaneRemoverProcessor::process_inplace(), EMAN::LowpassRandomPhaseProcessor::process_inplace(), EMAN::EMData::read_binedimage(), EMAN::EMData::read_image(), refalifn(), EMAN::EMData::scale_pixel(), EMAN::EMData::set_attr_dict(), set_default(), EMAN::PaintProcessor::set_params(), EMAN::MaskGaussNonuniformProcessor::set_params(), EMAN::CircularMaskProcessor::set_params(), EMAN::FiniteProcessor::set_params(), EMAN::KMeansAnalyzer::set_params(), EMAN::NewFourierProcessor::setbutterworthdefaults(), 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::FourierReconstructor::setup(), EMAN::FourierReconstructor::setup_seed(), EMAN::TestUtil::to_emobject(), EMAN::SpiderIO::write_single_header(), EMAN::RT3DSymmetryAligner::xform_align_nbest(), EMAN::RT3DSphereAligner::xform_align_nbest(), and EMAN::RT3DGridAligner::xform_align_nbest().

                {
                        map < string, EMObject >::const_iterator p = dict.find(key);
                        if (p != dict.end()) {
                                return true;
                        }
                        return false;
                }
bool Dict::has_key_ci ( const string &  key) const

Ask the Dictionary if it as a particular key in a case insensitive way.

Parameters:
keythe (string) key to find

Definition at line 1204 of file emobject.cpp.

References dict, and EMAN::Util::str_to_lower().

Referenced by EMAN::Transform::detect_problem_keys(), EMAN::Transform::set_params(), EMAN::Transform::set_params_inverse(), and EMAN::Transform::set_rotation().

{
        string lower_key = Util::str_to_lower(key);

        for (map < string, EMObject >::const_iterator it = dict.begin(); it != dict.end(); ++it ) {
                string lower = Util::str_to_lower(it->first);
                if (lower == lower_key) return true;
        }
        return false;
}
vector< string > EMAN::Dict::keys ( ) const [inline]

Get a vector containing all of the (string) keys in this dictionary.

Definition at line 480 of file emobject.h.

References dict.

Referenced by copy_keys_in(), EMAN::EMUtil::dump_dict(), EMAN::TestUtil::dump_emdata(), EMAN::EMData::set_attr_dict(), and EMAN::TestUtil::test_dict().

                {
                        vector < string > result;

                        map < string, EMObject >::const_iterator p;
                        for (p = dict.begin(); p != dict.end(); p++) {
                                result.push_back(p->first);
                        }

                        return result;
                }
Dict & Dict::operator= ( const Dict that)

Assignment operator Copies all elements in dict.

Definition at line 1075 of file emobject.cpp.

References begin(), copy(), dict, and end().

{
        if ( this != &that )
        {
                dict.clear();
                copy(that.begin(), that.end(), inserter(dict, dict.begin()));
                // or use this
                // dict.insert( that.begin(), that.end());
        }
        else
        {
                cerr << "Warning - attempted to assign a Dict object to itself. No action taken" << endl;
        }

        return *this;
}
EMObject& EMAN::Dict::operator[] ( const string &  key) [inline]

Definition at line 609 of file emobject.h.

References dict, and key.

                {
//                      static EMObject nullreturn;
//                      if( has_key(key) )  return dict[key];
//                      else return nullreturn;

//                      if( has_key(key) ) {
                                return dict[key];
//                      }
//                      else {
//                              LOGERR("No such key exist in this Dict");
//                              throw NotExistingObjectException("EMObject", "Nonexisting key (" + key + ") in Dict");
//                      }
                }
EMObject EMAN::Dict::operator[] ( const string &  key) const [inline]

Definition at line 624 of file emobject.h.

References dict, and key.

                {
//                      if( has_key(key) )  return dict[key];
//                      else return EMObject();
                        return dict[key];

//                      else {
//                              LOGERR("No such key exist in this Dict");
//                              throw NotExistingObjectException("EMObject", "Nonexisting key (" + key + ") in Dict");
//                      }
                }
void EMAN::Dict::put ( const string &  key,
EMObject  val 
) [inline]

Put the value/key pair into the dictionary probably better to just use operator[].

Definition at line 551 of file emobject.h.

References dict, and key.

Referenced by EMAN::NSigmaClampingProcessor::process_inplace(), and EMAN::SymSearchProcessor::process_inplace().

                {
                        dict[key] = val;
                }
template<typename type >
type EMAN::Dict::set_default ( const string &  key,
type  val 
) [inline]

Default setting behavior This can be achieved using a template - d.woolford Jan 2008 (before there was a function being written for every type)

Definition at line 575 of file emobject.h.

References dict, has_key(), and key.

Referenced by EMAN::FourierWeightAverager::add_image(), EMAN::ImageAverager::add_image(), EMAN::TomoAverager::add_image(), EMAN::OrientationGenerator::add_orientation(), EMAN::Refine3DAlignerGrid::align(), EMAN::Refine3DAlignerQuaternion::align(), EMAN::SymAlignProcessorQuat::align(), EMAN::RefineAlignerCG::align(), EMAN::RefineAligner::align(), EMAN::SymAlignProcessor::align(), EMAN::RTFSlowExhaustiveAligner::align(), EMAN::RTFExhaustiveAligner::align(), EMAN::RotateFlipAlignerIterative::align(), EMAN::RotateFlipAligner::align(), EMAN::RotateTranslateFlipAlignerPawel::align(), EMAN::RotateTranslateFlipScaleAlignerIterative::align(), EMAN::RotateTranslateFlipAlignerIterative::align(), EMAN::RotateTranslateFlipScaleAligner::align(), EMAN::RotateTranslateFlipAligner::align(), EMAN::RotateTranslateScaleAligner::align(), EMAN::RotateTranslateAligner::align(), EMAN::RotateTranslateAlignerPawel::align(), EMAN::RotateTranslateScaleAlignerIterative::align(), EMAN::RotateTranslateAlignerIterative::align(), EMAN::RotationalAlignerIterative::align(), EMAN::RotationalAligner::align(), EMAN::TranslationalAligner::align(), EMAN::ScaleAligner::align(), EMAN::ScaleAlignerABS::align_using_base(), EMAN::ShapeAnalyzer::analyze(), EMAN::InertiaMatrixAnalyzer::analyze(), EMAN::NormalizeCircleMeanProcessor::calc_mean(), EMAN::OptSubCmp::cmp(), EMAN::FRCCmp::cmp(), EMAN::PhaseCmp::cmp(), EMAN::OptVarianceCmp::cmp(), EMAN::QuadMinDotCmp::cmp(), EMAN::TomoFscCmp::cmp(), EMAN::TomoCccCmp::cmp(), EMAN::DotCmp::cmp(), EMAN::SqEuclideanCmp::cmp(), EMAN::LodCmp::cmp(), EMAN::CccCmp::cmp(), EMAN::LowpassAutoBProcessor::create_radial_func(), EMAN::WienerFourierReconstructor::finish(), EMAN::FourierReconstructor::finish(), EMAN::TomoAverager::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::OptimumOrientationGenerator::get_orientations_tally(), EMAN::SaffOrientationGenerator::get_orientations_tally(), EMAN::EvenOrientationGenerator::get_orientations_tally(), EMAN::EmanOrientationGenerator::get_orientations_tally(), EMAN::HSym::get_sym(), EMAN::DSym::get_sym(), EMAN::CSym::get_sym(), EMAN::HSym::is_in_asym_unit(), EMAN::DSym::is_in_asym_unit(), EMAN::CSym::is_in_asym_unit(), EMAN::BinarySkeletonizerProcessor::process(), EMAN::ScaleTransformProcessor::process(), EMAN::WatershedProcessor::process(), EMAN::IntTranslateProcessor::process(), EMAN::DirectionalSumProcessor::process(), EMAN::FSCFourierProcessor::process(), EMAN::CtfSimProcessor::process(), EMAN::SubtractOptProcessor::process(), EMAN::BooleanShrinkProcessor::process(), EMAN::MeanShrinkProcessor::process(), EMAN::FFTResampleProcessor::process(), EMAN::MedianShrinkProcessor::process(), EMAN::KmeansSegmentProcessor::process(), EMAN::ApplySymProcessor::process(), EMAN::DistanceSegmentProcessor::process(), EMAN::NewHomomorphicTanhProcessor::process_inplace(), EMAN::NewHighpassTanhProcessor::process_inplace(), EMAN::NewLowpassTanhProcessor::process_inplace(), EMAN::RotateInFSProcessor::process_inplace(), EMAN::ApplyPolynomialProfileToHelix::process_inplace(), EMAN::ModelEMCylinderProcessor::process_inplace(), EMAN::TomoTiltEdgeMaskProcessor::process_inplace(), EMAN::TomoTiltAngleWeightProcessor::process_inplace(), EMAN::ConvolutionProcessor::process_inplace(), EMAN::HistogramBin::process_inplace(), EMAN::NSigmaClampingProcessor::process_inplace(), EMAN::ClampingProcessor::process_inplace(), EMAN::ScaleTransformProcessor::process_inplace(), EMAN::IntTranslateProcessor::process_inplace(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::TestImageCirclesphere::process_inplace(), EMAN::TestImageAxes::process_inplace(), EMAN::TestImageGradient::process_inplace(), EMAN::TestImageLineWave::process_inplace(), EMAN::CTFSNRWeightProcessor::process_inplace(), EMAN::TestImageFourierNoiseGaussian::process_inplace(), EMAN::AutoMask3D2Processor::process_inplace(), EMAN::AutoMaskDustProcessor::process_inplace(), EMAN::StripeXYProcessor::process_inplace(), EMAN::PhaseToMassCenterProcessor::process_inplace(), EMAN::ToMassCenterProcessor::process_inplace(), EMAN::AddMaskShellProcessor::process_inplace(), EMAN::IterMultiMaskProcessor::process_inplace(), EMAN::AutoMask2DProcessor::process_inplace(), EMAN::BinarizeFourierProcessor::process_inplace(), EMAN::NormalizeToLeastSquareProcessor::process_inplace(), EMAN::NormalizeByMassProcessor::process_inplace(), EMAN::SigmaZeroEdgeProcessor::process_inplace(), EMAN::FlattenBackgroundProcessor::process_inplace(), EMAN::BooleanShrinkProcessor::process_inplace(), EMAN::MeanShrinkProcessor::process_inplace(), EMAN::FFTResampleProcessor::process_inplace(), EMAN::MedianShrinkProcessor::process_inplace(), EMAN::BoxStatProcessor::process_inplace(), EMAN::ToMinvalProcessor::process_inplace(), EMAN::Axis0FourierProcessor::process_inplace(), EMAN::FourierAnlProcessor::process_inplace(), EMAN::FourierProcessor::process_inplace(), EMAN::MaskSoftProcessor::set_params(), EMAN::MaskSharpProcessor::set_params(), EMAN::RecipCarefullyProcessor::set_params(), EMAN::FourierReconstructor::setup(), EMAN::FourierReconstructorSimple2D::setup(), EMAN::FourierReconstructor::setup_seed(), EMAN::RT3DSymmetryAligner::xform_align_nbest(), EMAN::RT3DSphereAligner::xform_align_nbest(), and EMAN::RT3DGridAligner::xform_align_nbest().

                {
                        if (!has_key(key)) {
                                dict[key] = val;
                        }
                        return dict[key];
                }
size_t EMAN::Dict::size ( ) const [inline]
vector< EMObject > EMAN::Dict::values ( ) const [inline]

Get a vector containing copies of each of the EMObjects in this dictionary.

Definition at line 494 of file emobject.h.

References dict.

Referenced by EMAN::EMUtil::dump_dict(), and EMAN::RealPixelProcessor::set_params().

                {
                        vector < EMObject > result;

                        map < string, EMObject >::const_iterator p;
                        for (p = dict.begin(); p != dict.end(); p++) {
                                result.push_back(p->second);
                        }

                        return result;
                }

Friends And Related Function Documentation

bool operator!= ( const Dict d1,
const Dict d2 
) [friend]

Friend declaration operator!= namespace EMAN2 operator!= accesses private variables.

bool operator== ( const Dict d1,
const Dict d2 
) [friend]

Friend declaration operator== namespace EMAN2 operator== accesses private variables.


Member Data Documentation

map< string, EMObject > EMAN::Dict::dict [mutable, private]

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