Event::Relation< T1, T2 > Class Template Reference

#include <Relation.h>

Inheritance diagram for Event::Relation< T1, T2 >:

ContainedObject List of all members.

Public Member Functions

virtual const CLID & clID () const
 Relation (T1 *obj1, T2 *obj2)
 Relation (T1 *obj1, T2 *obj2, std::string info)
 Relation (T1 *obj1, T2 *obj2, std::vector< std::string > infos)
const T1 * getFirst () const
T1 * getFirst ()
const T2 * getSecond () const
T2 * getSecond ()
void addInfo (std::string inf)
 Add additional information (as a string) to the relation.
std::vector< std::stringgetInfos () const
std::ostreamfillStream (std::ostream &s) const
 Fill the ASCII output stream.

Static Public Member Functions

static const CLID & classID ()

Private Member Functions

void setFirst (T1 *obj)
void setSecond (T2 *obj)

Private Attributes

RelKey< T1, T1, T2 > m_first
 Key associated to the first object to be related.
RelKey< T2, T1, T2 > m_second
 Key associated to the second object to be related.
std::vector< std::stringm_infos
 Additional information associated to the relation.

Friends

class RelTable< T1, T2 >

Detailed Description

template<class T1, class T2>
class Event::Relation< T1, T2 >

Definition at line 35 of file Relation.h.


Constructor & Destructor Documentation

template<class T1, class T2>
Event::Relation< T1, T2 >::Relation ( T1 *  obj1,
T2 *  obj2 
) [inline]

Definition at line 43 of file Relation.h.

00043 : m_first(obj1), m_second(obj2) {}

template<class T1, class T2>
Relation::Relation ( T1 *  obj1,
T2 *  obj2,
std::string  info 
) [inline]

Definition at line 79 of file Relation.h.

00079                                                                   : 
00080   m_first(obj1), m_second(obj2), m_infos(1,info) {}

template<class T1, class T2>
Relation::Relation ( T1 *  obj1,
T2 *  obj2,
std::vector< std::string infos 
) [inline]

Definition at line 84 of file Relation.h.

00084                                                                               : 
00085   m_first(obj1), m_second(obj2), m_infos(infos) {}


Member Function Documentation

template<class T1, class T2>
void Relation::addInfo ( std::string  inf  ) 

Add additional information (as a string) to the relation.

Definition at line 90 of file Relation.h.

References Event::Relation< T1, T2 >::m_infos.

00090                                            {
00091     // Purpose and Method:  This routine add additional information to the relation.
00092     // Inputs:  inf is the information to be added.
00093     
00094   m_infos.push_back(inf);
00095 
00096 }

template<class T1, class T2>
static const CLID& Event::Relation< T1, T2 >::classID (  )  [inline, static]

Reimplemented in RecMdcHitOnTrack.

Definition at line 40 of file Relation.h.

Referenced by Event::Relation< RecMdcHit, RecMdcTrack >::clID().

00040 { return CLID_Relation; }

template<class T1, class T2>
virtual const CLID& Event::Relation< T1, T2 >::clID (  )  const [inline, virtual]

Reimplemented in RecMdcHitOnTrack.

Definition at line 39 of file Relation.h.

00039 { return Relation::classID(); }

template<class T1, class T2>
std::ostream & Relation::fillStream ( std::ostream s  )  const [inline]

Fill the ASCII output stream.

Definition at line 109 of file Relation.h.

References genRecEmupikp::i, Event::Relation< T1, T2 >::m_first, Event::Relation< T1, T2 >::m_infos, Event::Relation< T1, T2 >::m_second, and Event::RelKey< T1, T2, T3 >::toStream().

Referenced by main().

00109                                                                     {
00110   // Fill the ASCII output stream
00111   s << "      Base class Relation"
00112     << "\n        First Column: ";
00113   m_first.toStream(s);
00114   s << "\n        Second Column: "; 
00115   m_second.toStream(s);
00116   s << "\n        Additional Information: ";
00117   
00118   std::vector<std::string>::const_iterator i;
00119   for(i = m_infos.begin(); i != m_infos.end(); i++)
00120     {
00121       s << "\n          " << *i;
00122     }
00123   return s;
00124 }

template<class T1, class T2>
T1* Event::Relation< T1, T2 >::getFirst (  )  [inline]

Definition at line 48 of file Relation.h.

00048 { return m_first.getData();}

template<class T1, class T2>
const T1* Event::Relation< T1, T2 >::getFirst (  )  const [inline]

Definition at line 47 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::bindRelationFirst(), Event::RelTable< T1, T2 >::bindRelationNoDup(), and main().

00047 {return m_first.getData();} 

template<class T1, class T2>
std::vector< std::string > Relation::getInfos (  )  const

Definition at line 99 of file Relation.h.

References Event::Relation< T1, T2 >::m_infos.

00099                                                      {
00100     // Purpose and Method: This routine get the additional information
00101     // associated to the relation. 
00102     // Outputs: a vector of strings
00103 
00104     return m_infos;
00105 }

template<class T1, class T2>
T2* Event::Relation< T1, T2 >::getSecond (  )  [inline]

Definition at line 51 of file Relation.h.

00051 { return m_second.getData();}    

template<class T1, class T2>
const T2* Event::Relation< T1, T2 >::getSecond (  )  const [inline]

Definition at line 50 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::bindRelationSecond(), Event::RelTable< T1, T2 >::findDup(), and main().

00050 {return m_second.getData();} 

template<class T1, class T2>
void Event::Relation< T1, T2 >::setFirst ( T1 *  obj  )  [inline, private]

Definition at line 71 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::changeFirst().

00071 {m_first.setData(obj);}

template<class T1, class T2>
void Event::Relation< T1, T2 >::setSecond ( T2 *  obj  )  [inline, private]

Definition at line 72 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::changeSecond().

00072 {m_second.setData(obj);}


Friends And Related Function Documentation

template<class T1, class T2>
friend class RelTable< T1, T2 > [friend]

Definition at line 60 of file Relation.h.


Member Data Documentation

template<class T1, class T2>
RelKey<T1,T1,T2> Event::Relation< T1, T2 >::m_first [private]

Key associated to the first object to be related.

Definition at line 65 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::bindRelationFirst(), Event::RelTable< T1, T2 >::bindRelationNoDup(), Event::Relation< T1, T2 >::fillStream(), Event::RelTable< T1, T2 >::findDup(), Event::Relation< RecMdcHit, RecMdcTrack >::getFirst(), Event::RelTable< T1, T2 >::removeFirst(), and Event::Relation< RecMdcHit, RecMdcTrack >::setFirst().

template<class T1, class T2>
std::vector<std::string> Event::Relation< T1, T2 >::m_infos [private]

Additional information associated to the relation.

Definition at line 69 of file Relation.h.

Referenced by Event::Relation< T1, T2 >::addInfo(), Event::RelTable< T1, T2 >::bindRelationNoDup(), Event::Relation< T1, T2 >::fillStream(), and Event::Relation< T1, T2 >::getInfos().

template<class T1, class T2>
RelKey<T2,T1,T2> Event::Relation< T1, T2 >::m_second [private]

Key associated to the second object to be related.

Definition at line 67 of file Relation.h.

Referenced by Event::RelTable< T1, T2 >::bindRelationSecond(), Event::Relation< T1, T2 >::fillStream(), Event::Relation< RecMdcHit, RecMdcTrack >::getSecond(), Event::RelTable< T1, T2 >::removeSecond(), and Event::Relation< RecMdcHit, RecMdcTrack >::setSecond().


Generated on Tue Nov 29 23:36:33 2016 for BOSS_7.0.2 by  doxygen 1.4.7