\section{U\-T\-I\-L\-:\-:L\-C\-Relation\-Navigator Class Reference}
\label{classUTIL_1_1LCRelationNavigator}\index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}


The \doxyref{L\-C\-Relation\-Navigator}{p.}{classUTIL_1_1LCRelationNavigator} makes repeated lookup of relations more conveneient and efficient.  




{\ttfamily \#include $<$U\-T\-I\-L/\-L\-C\-Relation\-Navigator.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
{\bf L\-C\-Relation\-Navigator} (const std\-::string \&from\-Type, const std\-::string \&to\-Type)\label{classUTIL_1_1LCRelationNavigator_ab40d28afd011c5e2b41370bec68690b1}

\begin{DoxyCompactList}\small\item\em Default constructor. \end{DoxyCompactList}\item 
{\bf L\-C\-Relation\-Navigator} (const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Collection} $\ast$col)\label{classUTIL_1_1LCRelationNavigator_a453d93fe0cbb55bfcadadbab0208f9b1}

\begin{DoxyCompactList}\small\item\em Create the navigator object from an existing collection of relations. \end{DoxyCompactList}\item 
virtual {\bf $\sim$\-L\-C\-Relation\-Navigator} ()\label{classUTIL_1_1LCRelationNavigator_a6e0cbdc1fbefd59ea67b6a4d360cb6a7}

\begin{DoxyCompactList}\small\item\em Destructor. \end{DoxyCompactList}\item 
virtual const std\-::string \& {\bf get\-From\-Type} () const \label{classUTIL_1_1LCRelationNavigator_a4ffadcee37b990ac187737168ee53d8c}

\begin{DoxyCompactList}\small\item\em The type of the 'from' objects in this relation. \end{DoxyCompactList}\item 
virtual const std\-::string \& {\bf get\-To\-Type} () const \label{classUTIL_1_1LCRelationNavigator_ae1a3800c4644337a940d26277cc60dac}

\begin{DoxyCompactList}\small\item\em The type of the 'to' objects in this relation. \end{DoxyCompactList}\item 
virtual const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object\-Vec} \& {\bf get\-Related\-To\-Objects} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from) const 
\begin{DoxyCompactList}\small\item\em All objects that the given from-\/object is related to. \end{DoxyCompactList}\item 
virtual const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object\-Vec} \& {\bf get\-Related\-From\-Objects} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to) const 
\begin{DoxyCompactList}\small\item\em All from-\/objects related to the given object ( the inverse relationship). \end{DoxyCompactList}\item 
virtual const {\bf E\-V\-E\-N\-T\-::\-Float\-Vec} \& {\bf get\-Related\-To\-Weights} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from) const 
\begin{DoxyCompactList}\small\item\em The weights of the relations returned by a call to get\-Related\-To\-Objects(from). \end{DoxyCompactList}\item 
virtual const {\bf E\-V\-E\-N\-T\-::\-Float\-Vec} \& {\bf get\-Related\-From\-Weights} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to) const 
\begin{DoxyCompactList}\small\item\em The weights of the relations returned by a call to get\-Related\-From\-Objects(to). \end{DoxyCompactList}\item 
virtual void {\bf add\-Relation} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from, {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to, float weight=1.\-0)
\begin{DoxyCompactList}\small\item\em Adds a relation. \end{DoxyCompactList}\item 
virtual void {\bf remove\-Relation} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from, {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to)\label{classUTIL_1_1LCRelationNavigator_a88cd5ed218beb79b2125901bf0804588}

\begin{DoxyCompactList}\small\item\em Remove a given relation. \end{DoxyCompactList}\item 
virtual {\bf E\-V\-E\-N\-T\-::\-L\-C\-Collection} $\ast$ {\bf create\-L\-C\-Collection} ()
\begin{DoxyCompactList}\small\item\em Remove a given relation. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual void {\bfseries initialize} (const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Collection} $\ast$col)\label{classUTIL_1_1LCRelationNavigator_a278b8e2be00651d4aa7ac615c5e6f367}

\item 
void {\bfseries remove\-Relation} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from, {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to, Rel\-Map \&map)\label{classUTIL_1_1LCRelationNavigator_a313481f99102aa37bcf615f97df25686}

\item 
void {\bfseries add\-Relation} ({\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$from, {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$to, float weight, Rel\-Map \&map)\label{classUTIL_1_1LCRelationNavigator_a369f3d8f578bab39574fe1a7cb165369}

\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
Rel\-Map {\bfseries \-\_\-map}\label{classUTIL_1_1LCRelationNavigator_a2225f87899e3d5b120c2b600a068bdf6}

\item 
Rel\-Map {\bfseries \-\_\-r\-Map}\label{classUTIL_1_1LCRelationNavigator_a26355fea2bdcd7f92cf4b195d0de99e3}

\item 
std\-::string {\bfseries \-\_\-from}\label{classUTIL_1_1LCRelationNavigator_a3179c5a8330eb271e9eeb5a06fdc9d78}

\item 
std\-::string {\bfseries \-\_\-to}\label{classUTIL_1_1LCRelationNavigator_ac2b9ee0263b12b01891c88dc4629b7e2}

\end{DoxyCompactItemize}


\subsection{Detailed Description}
The \doxyref{L\-C\-Relation\-Navigator}{p.}{classUTIL_1_1LCRelationNavigator} makes repeated lookup of relations more conveneient and efficient. 

The relations are treated symmetrical, i.\-e. lookup of relations is equally efficient and fast for either direction (from-\/to and to-\/from) at the price of a slower (by a factor of $\sim$2) modification speed.

\begin{DoxyAuthor}{Author}
gaede 
\end{DoxyAuthor}
\begin{DoxyVersion}{Version}

\end{DoxyVersion}
\begin{DoxyParagraph}{Id\-:}
\doxyref{L\-C\-Relation\-Navigator.\-h}{p.}{LCRelationNavigator_8h_source},v 1.\-2 2004-\/09-\/06 14\-:35\-:51 gaede Exp 
\end{DoxyParagraph}


\subsection{Member Function Documentation}
\index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!add\-Relation@{add\-Relation}}
\index{add\-Relation@{add\-Relation}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{add\-Relation}]{\setlength{\rightskip}{0pt plus 5cm}void U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::add\-Relation (
\begin{DoxyParamCaption}
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{from, }
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{to, }
\item[{float}]{weight = {\ttfamily 1.0}}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_aaf28fd10f298301b7e65f2dcd1d88b8b}


Adds a relation. 

If there is already an existing relation between the two given objects the weight (or default weight 1.\-0) is added to that relationship's weight. 

References add\-Relation().



Referenced by add\-Relation().

\index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!create\-L\-C\-Collection@{create\-L\-C\-Collection}}
\index{create\-L\-C\-Collection@{create\-L\-C\-Collection}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{create\-L\-C\-Collection}]{\setlength{\rightskip}{0pt plus 5cm}{\bf E\-V\-E\-N\-T\-::\-L\-C\-Collection} $\ast$ U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::create\-L\-C\-Collection (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_ae1cf3383f897235c0fe0e74b3aacc2cc}


Remove a given relation. 

To reduce the weight of the relationship, call add\-Relation( from, to, weight  ) with weight$<$0. 

References I\-M\-P\-L\-::\-L\-C\-Collection\-Vec\-::add\-Element(), I\-M\-P\-L\-::\-L\-C\-Flag\-Impl\-::get\-Flag(), get\-From\-Type(), get\-To\-Type(), I\-M\-P\-L\-::\-L\-C\-Collection\-Vec\-::parameters(), I\-M\-P\-L\-::\-L\-C\-Flag\-Impl\-::set\-Bit(), I\-M\-P\-L\-::\-L\-C\-Collection\-Vec\-::set\-Flag(), and E\-V\-E\-N\-T\-::\-L\-C\-Parameters\-::set\-Value().

\index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!get\-Related\-From\-Objects@{get\-Related\-From\-Objects}}
\index{get\-Related\-From\-Objects@{get\-Related\-From\-Objects}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{get\-Related\-From\-Objects}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object\-Vec} \& U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::get\-Related\-From\-Objects (
\begin{DoxyParamCaption}
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{to}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_ab725175ce3c9aefd39b4d3fd58c663a0}


All from-\/objects related to the given object ( the inverse relationship). 

L\-C\-Objects are of type \doxyref{get\-From\-Type()}{p.}{classUTIL_1_1LCRelationNavigator_a4ffadcee37b990ac187737168ee53d8c}. \index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!get\-Related\-From\-Weights@{get\-Related\-From\-Weights}}
\index{get\-Related\-From\-Weights@{get\-Related\-From\-Weights}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{get\-Related\-From\-Weights}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf E\-V\-E\-N\-T\-::\-Float\-Vec} \& U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::get\-Related\-From\-Weights (
\begin{DoxyParamCaption}
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{to}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_a5586adb827fb1a0ce74c772cea742151}


The weights of the relations returned by a call to get\-Related\-From\-Objects(to). 

\begin{DoxySeeAlso}{See Also}
\doxyref{get\-Related\-From\-Objects}{p.}{classUTIL_1_1LCRelationNavigator_ab725175ce3c9aefd39b4d3fd58c663a0} 
\end{DoxySeeAlso}
\index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!get\-Related\-To\-Objects@{get\-Related\-To\-Objects}}
\index{get\-Related\-To\-Objects@{get\-Related\-To\-Objects}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{get\-Related\-To\-Objects}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf E\-V\-E\-N\-T\-::\-L\-C\-Object\-Vec} \& U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::get\-Related\-To\-Objects (
\begin{DoxyParamCaption}
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{from}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_a96d5110dd09164ba6d8ac6e76907ed5b}


All objects that the given from-\/object is related to. 

L\-C\-Objects are of type \doxyref{get\-To\-Type()}{p.}{classUTIL_1_1LCRelationNavigator_ae1a3800c4644337a940d26277cc60dac}. \index{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}!get\-Related\-To\-Weights@{get\-Related\-To\-Weights}}
\index{get\-Related\-To\-Weights@{get\-Related\-To\-Weights}!UTIL::LCRelationNavigator@{U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator}}
\subsubsection[{get\-Related\-To\-Weights}]{\setlength{\rightskip}{0pt plus 5cm}const {\bf E\-V\-E\-N\-T\-::\-Float\-Vec} \& U\-T\-I\-L\-::\-L\-C\-Relation\-Navigator\-::get\-Related\-To\-Weights (
\begin{DoxyParamCaption}
\item[{{\bf E\-V\-E\-N\-T\-::\-L\-C\-Object} $\ast$}]{from}
\end{DoxyParamCaption}
) const\hspace{0.3cm}{\ttfamily [virtual]}}\label{classUTIL_1_1LCRelationNavigator_ad46fd9d4c2ccad675c8d0fce0cb0e642}


The weights of the relations returned by a call to get\-Related\-To\-Objects(from). 

\begin{DoxySeeAlso}{See Also}
\doxyref{get\-Related\-To\-Objects}{p.}{classUTIL_1_1LCRelationNavigator_a96d5110dd09164ba6d8ac6e76907ed5b} 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files\-:\begin{DoxyCompactItemize}
\item 
L\-C\-Relation\-Navigator.\-h\item 
L\-C\-Relation\-Navigator.\-cc\end{DoxyCompactItemize}
