#include <RelationBases.h>
Public Member Functions | |
RelationRetargetBase (const Target &target) | |
RelationRetargetBase (const RelationRetargetBase< Target > &model) | |
virtual | ~RelationRetargetBase () |
Target & | target () |
const Target & | target () const |
virtual RelationListItem * | retarget (const Target &target) const =0 |
Protected Attributes | |
Target | target_m |
RelationListItem | RelationRetargetBase<Target> | RelationBase<Target, Functor> | Relation<Target, Functor>
The hierarchy exists to incrementally supply services and expose the Target and Functor template parameters.
It is sometimes necessary to be able to replace the target of an relation with another object. RelationListItem is not templated, so the idea is to do a dynamic_cast to an RelationRetargetBase and then call the virtual retarget function, which needs to be implemented in an RelationBase subclass.
RelationRetargetBase provides an interface for storing and accessing the target; that is, the object that is going to be updated by this relation.
Subclasses must define the retarget function, which is used to create a clone of this Relation, but with a new target.
RelationRetargetBase< Target >::RelationRetargetBase | ( | const Target & | target | ) | [inline] |
RelationRetargetBase< Target >::RelationRetargetBase | ( | const RelationRetargetBase< Target > & | model | ) | [inline] |
virtual RelationRetargetBase< Target >::~RelationRetargetBase | ( | ) | [inline, virtual] |
Target& RelationRetargetBase< Target >::target | ( | ) | [inline] |
const Target& RelationRetargetBase< Target >::target | ( | ) | const [inline] |
virtual RelationListItem* RelationRetargetBase< Target >::retarget | ( | const Target & | target | ) | const [pure virtual] |
Implemented in Relation0< Target, RelationFunctor >, Relation1< Target, R1, RelationFunctor >, Relation2< Target, R1, R2, RelationFunctor >, Relation3< Target, R1, R2, R3, RelationFunctor >, Relation4< Target, R1, R2, R3, R4, RelationFunctor >, Relation5< Target, R1, R2, R3, R4, R5, RelationFunctor >, and Relation6< Target, R1, R2, R3, R4, R5, R6, RelationFunctor >.
Referenced by RelationList::makeOwnCopy().
Target RelationRetargetBase< Target >::target_m [protected] |
Referenced by RelationRetargetBase< Target >::target().