Hi Gerrit,

Gerrit Voß wrote:
> 
> yes NullFC is gone, if you want to you can do the normal == NULL or 
> != NULL comparisons. I have to check the boolean part. IIRC the old
> fcptr had something special in there which the current one does not
> have.

That would be good to add, yes.

> A general comment on RecPtr though. They are meant for the app to
> permanently store a pointer to an object and keep the refcounts
> correct in clustered environments. This comes with an overhead, so
> for temporary pointers it is better to either use UnrecPtr or the
> raw pointer. Especially those that are used as function parameters.

In general raw pointers should be the preferred method, as they keep things 
closer to other code. Only use the other pointer types if they're really needed.

> yes, it is and actually in a more general form as we don't allow
> TransitPtr to raw ptr conversions. The reason is that if we would, after
> 
> XXX *ptr = XXX::create();
> 
> ptr would point to an already destroyed object. I'm aware that
> this results in the inconvenient fact that something like
> 
> objA->set(ObjB::create()); 
> 
> does not work out of the box. I'm still looking for a nice
> solution which does not just add 'set transit ptr' variants.

Is there a problem with that besides the API explosion? Given that most of that 
code is auto-generated I could probably live with that.

> which is correct as node->getCore returns a std C++ NodeCore * so you 
> can work with the std dynamic_cast. We did not overload the
> dynamic_pointer_cast for std pointers. IIRC this follows boost.

Hmm, well, it might be in line with boost, but that still makes it somewhat 
annoying.

Are there other reasons not to allow it? It would make it easier to use, as you 
can use dynamic_pointer_cast everywhere and not think about it/have to change 
it 
when the pointer types changes.

> For multi-threading the only important thing is you have to
> start with the pointer for the correct aspect. All FieldContainer
> pointers stored inside OpenSG FieldContainers point to objects in the
> same aspect. 
> 
> There are two ways to do that. You either can convert to the respective
> aspect manually like the csm window does
> 
>     Window* pThreadLocalWin = 
>         convertToCurrentAspect<Window *>(_pWindow.get());
> 
> before it calls render, or you can use the mt variant of the ptr,
> which interestingly are only available for rec and weak variants
> and also lack the traversal functions. I'll check and make it
> consistent.

Great, thanks.

Yours

        Dirk

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to