[Dune] [#1104] Remove EntityPointer in favour of improved Entity objects. (Attachment added)

Dune flyspray at dune-project.org
Mon May 14 15:26:36 CEST 2012


THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.

A new Flyspray task has been opened.  Details are below. 

User who did this - Robert Klöfkorn (robertk) 

Attached to Project - Dune
Summary - Remove EntityPointer in favour of improved Entity objects.
Task Type - Feature Request
Category - Grid
Status - New
Assigned To - 
Operating System - Unspecified / All
Severity - High
Priority - High
Reported Version - SVN (pre2.3)
Due in Version - 2.3
Due Date - Undecided
Details - Problem description: There are a number of problems with the EntityPointer class.

    - It does not behave like a pointer and in fact it can 
      not do so, because Entities can be on-the-fly objects.
    - Dereferencing an EntityPointer returns a reference, 
      therefore the EntityPointer basically has to contain 
      the Entity so that two concepts are rolled into one.
    - Storing Entities through the EntityPointer is not 
      really feasible because EntityPointers contain the 
      Entity. To allow light weight storage the 
      concept of an EntitySeed is available. For many grids 
      this need not contain more than a pointer or a few 
      indices. The grid then provides methods to convert an 
      EntitySeed to an Entity.
    - Having fewer classes to code reduces the work for 
      implementing a new grid.
    - Avoid problems with the following line of code (already happend many 
      times): 
   
      const Entity & outside = *(intersection.outside());
      // here the corresponding entity pointer already went out of scope
      outside.geometry()
  
      The compiler cannopt warn about this, but this will fail or give wrong 
      results, depending on the grid implementation.  

    - There should be some performance gain for example 
      with MetaGrids since they do not have to store there 
      own EntityPointer the HostEntityPointer...

Proposal:
Removal of EntityPointer: The transition should be not to difficult since the typedef for EntityPointer will point to Entity and on the Entity class we introduce the method

        const Entity* operator -> () const { return this; }

Iterators will return entity objects. A example implementation is attached. 

After this the interface will be much better to understand better to use. In fact, all methods returning a reference to an object should be revised.

Storage of entities: For "storage" of Entities in array-like structures we use the concept EntitySeed.


One or more files have been attached.

More information can be found at the following URL:
http://www.dune-project.org/flyspray/index.php?do=details&task_id=1104

You are receiving this message because you have requested it from the Flyspray bugtracking system.  If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.




More information about the Dune mailing list