YGP::Relation1_1< S, T > Class Template Reference

1-to-1 relation. More...

Inherits YGP::IRelation.

List of all members.

Public Member Functions

 Relation1_1 (const char *name)
virtual ~Relation1_1 ()
void relate (const S &source, const T &target) throw (std::overflow_error)
void unrelate (const S &source, const T &target)
void unrelateAll ()
bool isRelated (const S &owner) const
bool isRelated (const T &object) const
bool isRelated (const S &owner, const T &object) const
T & getObject (const S &owner)
const T & getObject (const S &owner) const
S & getParent (const T &object)
const S & getParent (const T &object) const


Detailed Description

template<class S, class T>
class YGP::Relation1_1< S, T >

1-to-1 relation.

Each object is connected to exactly one other (if at all).


Constructor & Destructor Documentation

template<class S , class T >
YGP::Relation1_1< S, T >::Relation1_1 ( const char *  name  )  [inline]

Defaultconstructor.

template<class S , class T >
virtual YGP::Relation1_1< S, T >::~Relation1_1 (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<class S , class T >
const T& YGP::Relation1_1< S, T >::getObject ( const S &  owner  )  const [inline]

Returns the child which is related with the passed object.

Parameters:
owner Parent whose object should be returned
Returns:
const T The related object
Remarks:
The object must be related

template<class S , class T >
T& YGP::Relation1_1< S, T >::getObject ( const S &  owner  )  [inline]

Returns the child which is related with the passed object.

Parameters:
owner Parent whose object should be returned
Returns:
T The related object
Remarks:
The object must be related

template<class S , class T >
const S& YGP::Relation1_1< S, T >::getParent ( const T &  object  )  const [inline]

Returns the parent of the passed object.

Parameters:
object Child whose parent should be returned
Returns:
S The related parent
Remarks:
The object must be related

template<class S , class T >
S& YGP::Relation1_1< S, T >::getParent ( const T &  object  )  [inline]

Returns the parent of the passed object.

Parameters:
object Child whose parent should be returned
Returns:
S The related parent
Remarks:
The object must be related

template<class S , class T >
bool YGP::Relation1_1< S, T >::isRelated ( const S &  owner,
const T &  object 
) const [inline]

Checks if the passed objects are related to each other (within this relation).

Parameters:
owner Parent which should be checked for being related
object Child which should be checked for relations

template<class S , class T >
bool YGP::Relation1_1< S, T >::isRelated ( const T &  object  )  const [inline]

Checks if the passed object is related to any other (within this relation).

Parameters:
object Child which should be checked for being related

template<class S , class T >
bool YGP::Relation1_1< S, T >::isRelated ( const S &  owner  )  const [inline]

Checks if the passed object is related to any other (within this relation).

Parameters:
owner Parent which should be checked for relations

template<class S , class T >
void YGP::Relation1_1< S, T >::relate ( const S &  source,
const T &  target 
) throw (std::overflow_error) [inline]

Connects two objects.

Parameters:
source Parent to relate
target Child to relate with parent

template<class S , class T >
void YGP::Relation1_1< S, T >::unrelate ( const S &  source,
const T &  target 
) [inline]

Disconnects two objects.

Parameters:
source Parent to unrelate
target Child to unrelate from parent

template<class S , class T >
void YGP::Relation1_1< S, T >::unrelateAll (  )  [inline]

Disconnect all objects.


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

YGP Version 0.9.31 - Generated on Wed Nov 18 11:25:28 2009 by doxygen 1.5.8