FreePOOMA  2.4.1
Public Member Functions | Protected Attributes
RelationRetargetBase< Target > Class Template Reference

RelationRetargetBase is an abstract base class for all relations: More...

#include <RelationBases.h>

Inheritance diagram for RelationRetargetBase< Target >:
Inheritance graph
[legend]
Collaboration diagram for RelationRetargetBase< Target >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 RelationRetargetBase (const Target &target)
 RelationRetargetBase (const RelationRetargetBase< Target > &model)
virtual ~RelationRetargetBase ()
Target & target ()
const Target & target () const
virtual RelationListItemretarget (const Target &target) const =0

Protected Attributes

Target target_m

Detailed Description

template<class Target>
class RelationRetargetBase< Target >

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.


Constructor & Destructor Documentation

template<class Target>
RelationRetargetBase< Target >::RelationRetargetBase ( const Target &  target) [inline]
template<class Target>
RelationRetargetBase< Target >::RelationRetargetBase ( const RelationRetargetBase< Target > &  model) [inline]
template<class Target>
virtual RelationRetargetBase< Target >::~RelationRetargetBase ( ) [inline, virtual]

Member Function Documentation

template<class Target>
Target& RelationRetargetBase< Target >::target ( ) [inline]
template<class Target>
const Target& RelationRetargetBase< Target >::target ( ) const [inline]
template<class Target>
virtual RelationListItem* RelationRetargetBase< Target >::retarget ( const Target &  target) const [pure virtual]

Member Data Documentation

template<class Target>
Target RelationRetargetBase< Target >::target_m [protected]

The documentation for this class was generated from the following file: