[geos-devel] Re: gettimeofday for win32

strk at refractions.net strk at refractions.net
Fri Dec 3 11:44:35 EST 2004


On Fri, Dec 03, 2004 at 09:09:14AM -0500, Frank Warmerdam wrote:
> On Fri, 3 Dec 2004 11:28:41 +0100, strk at refractions.net
> <strk at refractions.net> wrote:
> > On Thu, Dec 02, 2004 at 09:22:27AM -0500, Frank Warmerdam wrote:
> > 
> > (...)
> > >  o The use of the long long static uid in various items in geom.h caused
> > >     a problem.   I just hacked out the UIDs as they don't seem to have any
> > >     purpose.
> > 
> > That is mainly Martin's way of versioning classes.
> > Anyway a 64-bit int type is needed for the DoubleBits class, better
> > to handle win32 case in platform.h.
> 
> 
> Strk, 
> 
> Actually my problem here is that I don't know how to express 
> 64 bit constants for MSVC.  The "LL" (long long) postfix does not
> work.  Anyone know how to do this right? 

In this case I think the problem is only with class versioning.
Would a string be ok for that Martin ?

>  
> > >  o The base class toVector() returns a const result while the overrides return
> > >     non-const. I had to change the base to non-const as well, though I am
> > >     not clear what the original intent was.
> > 
> > We should probably have two methods:
> >         const vector<Coordinate>* toVector() const;
> >         vector<Coordinate>* toVector();
> 
> But the version of toVector() that returns a non-const result does not
> really affect the object is invoked on, so conceptually the method should
> still be const even if the result isn't.
>  
> Best regards,

Well.. my idea was to have read-only or read-write access to internal
storage, but this is really not applicable since the interface states
that the returned vector is not guaranteed to be the internal
representation of the sequence.

Unfortunately we cannot also give non const result as for our specific
DefaultCoordinateSequence case the returned vector is actually the
internal representation, and messing w/ it would modify the object.

I think we should keep the const qualifier on the return type.
I'll take a look at any unconsidered consequence.

--strk;



More information about the geos-devel mailing list