Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-23 Thread Bruno Chareyre
Done in r2962. Tested ok for GSTimeStepper, many tests can be removed when the fix is confirmed. B. > ok, so if deleting is not possible, then increment iterator until > there is something, or there is end. > -- ___ Bruno Chareyre Associate Professor ENSEĀ³ - Grenoble INP 11, rue des

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-22 Thread Janek Kozicki
Bruno Chareyre said: (by the date of Tue, 22 Nov 2011 10:34:51 +0100) > > > > In fact iterator should not only jump null bodies, but also remove > > them from container. > > > > By doing that, it would break the rule b=bodies[b.id], then it would need > a redirection that is painful to maintai

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-22 Thread Bruno Chareyre
> > In fact iterator should not only jump null bodies, but also remove > them from container. > > By doing that, it would break the rule b=bodies[b.id], then it would need a redirection that is painful to maintain. > It is the correct way, because even by C++ ISO specification an > iterator must

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-21 Thread Janek Kozicki
Bruno Chareyre said: (by the date of Mon, 21 Nov 2011 23:21:59 +0100) >for( ; bi!=biEnd ; ++bi ) > > >{ > > + if (!*bi) continue; > >shared_ptr b = *bi; > > > > I it not possible that iterator will return empty pointer. If it > > does, then it's

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-21 Thread Bruno Chareyre
for( ; bi!=biEnd ; ++bi ) >{ > + if (!*bi) continue; >shared_ptr b = *bi; > > I it not possible that iterator will return empty pointer. If it > does, then it's a bug in the iterator. > > The iterator is not empty, but the pointer it points to can be.

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-21 Thread Janek Kozicki
BodyContainer::iterator biEnd = bodies->end(); for( ; bi!=biEnd ; ++bi ) { + if (!*bi) continue; shared_ptr b = *bi; I it not possible that iterator will return empty pointer. If it does, then it's a bug in the iterator. It doesn't matter if

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-18 Thread Bruno Chareyre
There are so many places where this should be added that we should find another way. For instance, the ++ operator of body's itarators could include the check. It would automaticaly make future code removal safe. Very few developers would imagine that iterating on bodies can return no body. B p.s

Re: [Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-18 Thread Bruno Chareyre
There are so many places where this should be added that we should find another way. For instance, the ++ operator of body's itarators could include the check. It would automaticaly make future code removal safe. Very few developers would imagine that iterating on bodies can return no body. B On

[Yade-dev] [Branch ~yade-dev/yade/trunk] Rev 2961: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540

2011-11-18 Thread noreply
revno: 2961 fixes bug: https://launchpad.net/bugs/891540 committer: Anton Gladky branch nick: yade timestamp: Fri 2011-11-18 13:25:48 +0100 message: Add check on body existance in GlobalStiffnessTimeStepper. Fixes LP:891540 modified: