Changeset 6e97e5 for src/World.cpp


Ignore:
Timestamp:
Mar 17, 2010, 3:19:56 PM (16 years ago)
Author:
Tillmann Crueger <crueger@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
229e3c
Parents:
745a85
git-author:
Tillmann Crueger <crueger@…> (03/17/10 14:53:26)
git-committer:
Tillmann Crueger <crueger@…> (03/17/10 15:19:56)
Message:

Added a generic Iterator that can be used to iterate only over certain parts of an internal data structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/World.cpp

    r745a85 r6e97e5  
    1515#include "Descriptors/MoleculeDescriptor.hpp"
    1616#include "Descriptors/MoleculeDescriptor_impl.hpp"
     17#include "Descriptors/SelectiveIterator_impl.hpp"
    1718#include "Actions/ManipulateAtomsProcess.hpp"
    1819
     
    209210/******************************* Iterators ********************************/
    210211
    211 /*
    212  * Actual Implementation of the iterators can be found in WorldIterators.cpp
    213  */
     212// Build the AtomIterator from template
     213CONSTRUCT_SELECTIVE_ITERATOR(atom*,World::AtomSet,AtomDescriptor);
     214
    214215
    215216World::AtomIterator World::getAtomIter(AtomDescriptor descr){
    216   return AtomIterator(descr,this);
    217 }
    218 
    219 World::AtomSet::iterator World::atomEnd(){
    220   return atoms.end();
    221 }
     217  return AtomIterator(descr,atoms);
     218}
     219
     220World::AtomIterator World::atomEnd(){
     221  return AtomIterator(AllAtoms(),atoms,atoms.end());
     222}
     223
     224// build the MoleculeIterator from template
     225CONSTRUCT_SELECTIVE_ITERATOR(molecule*,World::MoleculeSet,MoleculeDescriptor);
    222226
    223227World::MoleculeIterator World::getMoleculeIter(MoleculeDescriptor descr){
    224   return MoleculeIterator(descr,this);
    225 }
    226 
    227 World::MoleculeSet::iterator World::moleculeEnd(){
    228   return molecules.end();
     228  return MoleculeIterator(descr,molecules);
     229}
     230
     231World::MoleculeIterator World::moleculeEnd(){
     232  return MoleculeIterator(AllMolecules(),molecules,molecules.end());
    229233}
    230234
Note: See TracChangeset for help on using the changeset viewer.