#include <RelationBases.h>


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.
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 |
| 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] |
References RelationRetargetBase< Target >::target_m.
| const Target& RelationRetargetBase< Target >::target | ( | ) | const [inline] |
References RelationRetargetBase< Target >::target_m.
| 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 Relation6< Target, R1, R2, R3, R4, R5, R6, RelationFunctor >::apply(), Relation5< Target, R1, R2, R3, R4, R5, RelationFunctor >::apply(), Relation4< Target, R1, R2, R3, R4, RelationFunctor >::apply(), Relation3< Target, R1, R2, R3, RelationFunctor >::apply(), Relation2< Target, R1, R2, RelationFunctor >::apply(), Relation1< Target, R1, RelationFunctor >::apply(), Relation0< Target, RelationFunctor >::apply(), and RelationRetargetBase< Target >::target().
1.5.5