Hi Gerrit,
Gerrit Voss wrote:
> Hi,
> I'm thinking of changing the getFoo field access functions to readFoo.
>
> The main reason is that with OSG_1_COMPAT enabled there are a lot of
> unnecessary changes recorded (internally during rendering), because
> the compiler selects the wrong, non const, get. Which means the
> performance is dreadful.
>
>> >From the two options,
>
> 1) chasing down all the locations and make sure the const version
> is used
> and
> 2) change getFoo to readFoo to make sure internally no unnecessary
> changes are recorded
>
> I'm currently leaning towards 2). Main reason is it will catch
> everything at once (at least internal). 1) will be a constant battle.
> Any opinions ??
just let me summarize this, to see if I get the implications right, for
option 2) we would get the following, yes?
readFoo() const;
editFoo();
#ifdef OSG_1_COMPAT
getFoo() const;
getFoo();
#endif
where
Foo *f;
Foo const *fc;
| now compat | now | new compat | new
f->getFoo() | non-const | const | non-const | error
fc->getFoo() | const | const | const | error
So for a user that defines OSG_1_COMPAT there would be no additional
changes required when porting to 2 and performance would be same (poor)
as without the change.
Those that do not use OSG_1_COMPAT can "quickly" find all places that
need to change, because the compiler will report errors.
I agree this is the better solution, long term, however I don't maintain
any code that depends on OpenSG, so I think the users list should be
asked for feedback on this.
Regards,
Carsten
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core