[geos-devel] use of const in GeometryFactory constructor
strk
strk at keybit.net
Thu Oct 9 14:34:11 EDT 2003
pramsey wrote:
> Keep in mind that some of the design decisions WRT pass-by-reference vs
> pass-by-value were made for performance reasons early on. Check your
> performance with the TestLineSweep program regularly and make sure
> things do not get worse while they get better...
>
> P.
Right now I'm just "formalizing" current behaviour.
My question about reverting getCoordinates() changes
is still open, and I can also revert LineString constructor
changes.
I think the addition of 'const' keywords in the code will
help all people involved in keeping consistency.
Actually, it brings to attention a lot of other architectural
issues, so much that I would commit the changes made so far to
permit parallel discussion about them. Note that the code will
not compile so far, but will warn about const objects misuse...
What do you think, should I commit ?
--strk;
>
> strk wrote:
> > Ok, problems with compiler seems to be gone (dunno how)...
> > I've already added a const keyword to PrecisionModel *
> > argument of GoemetryFactory constructor.
> >
> > Right now I'm in the process of formalizing the const nature
> > of the CoordinateList * passed to the LineString constructor,
> > and this is being really really long ... it is tainting the
> > whole code set !
> >
> > .. we might have found a good way to consistency ..
> >
> > --strk;
> >
> >
> > nhv wrote:
> >
> >>strk writes:
> >>
> >>>GeometryFactory(PrecisionModel * newPrecisionModel, int SRID)
> >>>Will copy the PrecisionModel arg into private space.
> >>>
> >>>The arguments naming convention used elsewere makes you think
> >>>the PresionModel object has to be created on purpose and thus
> >>>that you'll have to forget about it. Anyway this is not the
> >>>actual implementation and I don't know about usage of it
> >>>by other GEOS parts.
> >>>
> >>>As a test, I tried to "formalize" the implementation behaviour
> >>>adding a 'const' in front of the first arg both in GeometryFactory.cpp
> >>>and geom.h (and changing the name of it to disambiguate meaning).
> >>>
> >>>The library resulted by this was corrupted, when trying to run a
> >>>linked executable I got:
> >>>./example: error while loading shared libraries: ./example: undefined symbol:
> >>>__Q24geos15GeometryFactoryPQ24geos14PrecisionModeli
> >>>
> >>>Question 1: do you think using 'const' there is the right way to go ?
> >>
> >>Most likely
> >>http://www.parashift.com/c++-faq-lite/const-correctness.html
> >>
> >>
> >>>Question 2: do you think I've a bogus compiler ? (gcc-2.96)
> >>
> >>If it hasn't been patched *yes* 2.96 was a RedHat special that needed patching
> >>from it's original release < note this was not an official gnu release >
> >>check RedHat site for needed patches
> >>http://gcc.gnu.org/gcc-2.96.html
> >>
> >>The *real* 3.x series is *much* more C++ standard conformant and seems
> >>to produce slightly faster code esp on the newer procesors
> >>
> >>If you do upgrade I reccomend 3.3.1 < the current release >
> >>http://gcc.gnu.org/gcc-3.3/changes.html
> >>
> >>Norman
> >>
> >>_______________________________________________
> >>geos-devel mailing list
> >>geos-devel at geos.refractions.net
> >>http://geos.refractions.net/mailman/listinfo/geos-devel
> >
> >
> > _______________________________________________
> > geos-devel mailing list
> > geos-devel at geos.refractions.net
> > http://geos.refractions.net/mailman/listinfo/geos-devel
>
> --
> __
> /
> | Paul Ramsey
> | Refractions Research
> | Email: pramsey at refractions.net
> | Phone: (250) 885-0632
> \_
>
>
> _______________________________________________
> geos-devel mailing list
> geos-devel at geos.refractions.net
> http://geos.refractions.net/mailman/listinfo/geos-devel
More information about the geos-devel
mailing list