hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::mutual Namespace Reference

a namespace for mutually-connected objects More...

Classes

class  Base
 abstract base class for all mutually-connected objects More...
 
class  Multiple
 an object that can be mutually connected with any number of partners More...
 
class  Single
 an object which is mutually connected ("paired") with only one other object More...
 

Detailed Description

a namespace for mutually-connected objects

When implementing adaptive meshing, there are many situations where:

  • Two or more objects need to know about each other.
  • One of the objects may be moved or destroyed, in which case the other objects need to be notified so that they are not left with dangling pointers.

std::shared_ptr does not solve this problem. I am not trying to preserve an object until there are no remaining references to it. When it is time for an object to be deleted, I simply want everyone currently referencing it to know. This namespace provides the fundamental base classes to meet this need.