Changeset c6719d for src/Atom


Ignore:
Timestamp:
Jul 28, 2015, 2:03:59 PM (9 years ago)
Author:
Frederik Heber <heber@…>
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:
f54524
Parents:
df3f2f
git-author:
Frederik Heber <heber@…> (06/21/15 04:45:30)
git-committer:
Frederik Heber <heber@…> (07/28/15 14:03:59)
Message:

FIX: atom_bondedparticle signatures changed to more const versions.

  • added getBond() for obtaining bond in const manner.
Location:
src/Atom
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/atom_bondedparticle.cpp

    rdf3f2f rc6719d  
    109109 * @return pointer to created bond or to already present bonds
    110110 */
    111 bond::ptr BondedParticle::addBond(const unsigned int _step, BondedParticle* Partner)
     111bond::ptr BondedParticle::addBond(const unsigned int _step, BondedParticle* const Partner)
    112112{
    113113  const BondList &bondlist = getListOfBondsAtStep(_step);
     
    127127
    128128/**
     129 * Returns aan already present bond between this bonded particle and another.
     130 *
     131 * @param _step time step to access
     132 * @param bonding partner
     133 * @return pointer to already present bonds or containing NULL
     134 */
     135bond::ptr BondedParticle::getBondAtStep(
     136    const unsigned int _step,
     137    const BondedParticle* const Partner) const
     138{
     139  const BondList &bondlist = getListOfBondsAtStep(_step);
     140  for (BondList::const_iterator runner = bondlist.begin();
     141      runner != bondlist.end();
     142      runner++) {
     143    if ((*runner)->Contains(Partner))
     144      return *runner;
     145  }
     146  return bond::ptr();
     147}
     148
     149/**
    129150 * Adds a bond between this bonded particle and another. Returns present instance if this
    130151 * bond already exists.
     
    133154 * @return pointer to created bond or to already present bonds
    134155 */
    135 bond::ptr BondedParticle::addBond(BondedParticle* Partner)
     156bond::ptr BondedParticle::addBond(BondedParticle* const Partner)
    136157{
    137158  return addBond(WorldTime::getTime(), Partner);
     159}
     160
     161/**
     162 * Returns an already present bond between this bonded particle and another.
     163 *
     164 * @param bonding partner
     165 * @return pointer to already present bonds or containing NULL
     166 */
     167bond::ptr BondedParticle::getBond(const BondedParticle* const Partner) const
     168{
     169  return getBondAtStep(WorldTime::getTime(), Partner);
    138170}
    139171
     
    334366 * @return >=0 - first time step where bond appears, -1 - bond not present in lists
    335367 */
    336 int BondedParticle::ContainsBondAtStep(bond::ptr Binder) const
     368int BondedParticle::ContainsBondAtStep(const bond::ptr Binder) const
    337369{
    338370  int step = -1;
  • src/Atom/atom_bondedparticle.hpp

    rdf3f2f rc6719d  
    4444  virtual ~BondedParticle();
    4545
    46   bond::ptr addBond(const unsigned int _step, BondedParticle* Partner);
    47   bond::ptr addBond(BondedParticle* Partner);
    48   void removeBond(const unsigned int _step, BondedParticle* Partner);
    49   void removeBond(BondedParticle* Partner);
     46  bond::ptr addBond(const unsigned int _step, BondedParticle* const Partner);
     47  bond::ptr addBond(BondedParticle* const Partner);
     48  bond::ptr getBondAtStep(const unsigned int _step, const BondedParticle* const Partner) const;
     49  bond::ptr getBond(const BondedParticle* const Partner) const;
     50  void removeBond(const unsigned int _step, BondedParticle* const Partner);
     51  void removeBond(BondedParticle* const Partner);
    5052  void removeBond(bond::ptr &binder);
    5153  void removeAllBonds();
     
    6466  bool UnregisterBond(const unsigned int _step, bond::ptr const Binder);
    6567
    66   int ContainsBondAtStep(bond::ptr Binder) const;
     68  int ContainsBondAtStep(const bond::ptr Binder) const;
    6769
    6870private:
Note: See TracChangeset for help on using the changeset viewer.