====== connotation ======
Eine connotation ist eine Funktion, die sich vor oder nach die gerufene Funktion setzt.
Das Problem:
void RenderComposite::updateBbox( const DkGeo::Bbox3d& bbox )
{
_bbox += bbox;
if ( _parent )
_parent->updateBbox( bbox );
}
Hier muss eine Funktion updateBbox existieren, die _parent kennt. Die _bbox ist verbunden mit der _bbox von _parent.
Ich muss das aber wissen, ändere ich die _bbox so, wird Parent nicht informiert.
Gewünscht ist, dass dieses Verhalten auch das Parent informiert und daher
_bbox += bbox;
implizit auch _parent->_bbox += bbox aufruft:
operator += is connotation RenderComposite::_bbox( Bbox3d &rhs )
{
_bbox Bbox3d::+= rhs; // keine Endlosschleife
if( caller._parent )
_parent->_bbox += rhs; // ruft die Connotation von RenderComposite für parent auf.
}