[Dune] Getting rid of EntityPointer
Steffen Müthing
steffen.muething at iwr.uni-heidelberg.de
Wed Jan 21 17:41:47 CET 2015
Hi Marco,
Am 21.01.2015 um 17:16 schrieb Agnese, Marco <m.agnese13 at imperial.ac.uk>:
> Hi Duners,
> since in the future releases of Dune EntityPointer will disappear, I am trying to get rid of them in my codes.
>
> Let's suppose that I am iterating over the entities, and I want to access the father at level 0 of a given entity.
> Using EntityPointer is very simple:
>
> EntityPtr entityPtr(*it);
> while(entityPtr->hasFather())
> entityPtr=entityPtr->father();
>
> where it is my iterator. How can I do the same thing without using the EntityPointer?
> I can create a pointer to an entity as
>
> Entity* entityPtr(&(*it));
>
> but then, how can I go up in the hierarchical grid?
that issue is being discussed in FS#1511. With the next release of Dune, it will become possible
to copy and store entities directly without needing an EntityPointer. But right now, methods like
father() (or Intersection::inside() / outside()) still return an EntityPointer, which makes it impossible
to get rid of EntityPointer in your code.
The discussion in FS#1511 basically revolves around whether we want to change all the places that
return an EntityPointer right now to instead return an Entity, so that users can start replacing EntityPointer
with Entity in their code in Dune 2.4. There would of course be backwards compatibility code that makes sure
your code won’t break if you still use EntityPointer, but you would get lots of deprecation warnings.
The other option preferred by some developers is to keep the EntityPointer in 2.4 and simply remove it in
DUNE 3.0 (the next release after 2.4) without a transition period. I don’t like that option because it breaks lots
of user code (in a hard way because you get compiler errors instead of deprecation warnings). But that is not
decided yet.
In any case, this only applies to the current master (and the upcoming 2.4 release). In 2.3, it is definitely
impossible to get rid of the EntityPointer.
Best,
Steffen
>
> Thank you in advance,
> Marco.
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150121/cdda2b85/attachment.sig>
More information about the Dune
mailing list