FreePOOMA
2.4.1
|
RelationRetargetBase is an abstract base class for all relations: More...
#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 |
RelationRetargetBase is an abstract base class for all relations:
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] |
References RelationRetargetBase< Target >::target_m.
Referenced by Relation0< Target, RelationFunctor >::retarget(), Relation1< Target, R1, RelationFunctor >::retarget(), Relation2< Target, R1, R2, RelationFunctor >::retarget(), Relation3< Target, R1, R2, R3, RelationFunctor >::retarget(), Relation4< Target, R1, R2, R3, R4, RelationFunctor >::retarget(), Relation5< Target, R1, R2, R3, R4, R5, RelationFunctor >::retarget(), and Relation6< Target, R1, R2, R3, R4, R5, R6, RelationFunctor >::retarget().
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 Relation6< Target, R1, R2, R3, R4, R5, R6, RelationFunctor >, Relation5< Target, R1, R2, R3, R4, R5, RelationFunctor >, Relation4< Target, R1, R2, R3, R4, RelationFunctor >, Relation3< Target, R1, R2, R3, RelationFunctor >, Relation2< Target, R1, R2, RelationFunctor >, Relation1< Target, R1, RelationFunctor >, and Relation0< Target, RelationFunctor >.
Referenced by RelationList::makeOwnCopy().
Target RelationRetargetBase< Target >::target_m [protected] |
Referenced by Relation0< Target, RelationFunctor >::apply(), Relation1< Target, R1, RelationFunctor >::apply(), Relation2< Target, R1, R2, RelationFunctor >::apply(), Relation3< Target, R1, R2, R3, RelationFunctor >::apply(), Relation4< Target, R1, R2, R3, R4, RelationFunctor >::apply(), Relation5< Target, R1, R2, R3, R4, R5, RelationFunctor >::apply(), Relation6< Target, R1, R2, R3, R4, R5, R6, RelationFunctor >::apply(), and RelationRetargetBase< Target >::target().