5#include "GaudiKernel/ClassID.h"
6#include "GaudiKernel/ContainedObject.h"
22static const CLID CLID_Relation = 5100;
26 template <
class T1,
class T2>
class RelTable;
28 template <
class T1,
class T2>
class Relation :
public ContainedObject {
32 static const CLID&
classID() {
return CLID_Relation; }
34 Relation( T1* obj1, T2* obj2 ) : m_first( obj1 ), m_second( obj2 ) {}
35 Relation( T1* obj1, T2* obj2, std::string info );
36 Relation( T1* obj1, T2* obj2, std::vector<std::string> infos );
38 const T1*
getFirst()
const {
return m_first.getData(); }
41 const T2*
getSecond()
const {
return m_second.getData(); }
59 std::vector<std::string> m_infos;
61 void setFirst( T1* obj ) { m_first.
setData( obj ); }
62 void setSecond( T2* obj ) { m_second.
setData( obj ); }
65 template <
class T1,
class T2>
67 : m_first( obj1 ), m_second( obj2 ), m_infos( 1, info ) {}
69 template <
class T1,
class T2>
71 : m_first( obj1 ), m_second( obj2 ), m_infos( infos ) {}
77 m_infos.push_back( inf );
88 template <
class T1,
class T2>
91 s <<
" Base class Relation"
92 <<
"\n First Column: ";
93 m_first.toStream(
s );
94 s <<
"\n Second Column: ";
95 m_second.toStream(
s );
96 s <<
"\n Additional Information: ";
98 std::vector<std::string>::const_iterator i;
99 for ( i = m_infos.begin(); i != m_infos.end(); i++ ) {
s <<
"\n " << *i; }
Relation(T1 *obj1, T2 *obj2, std::string info)
void addInfo(std::string inf)
Add additional information (as a string) to the relation.
std::ostream & fillStream(std::ostream &s) const
Fill the ASCII output stream.
static const CLID & classID()
virtual const CLID & clID() const
Relation(T1 *obj1, T2 *obj2, std::vector< std::string > infos)
std::vector< std::string > getInfos() const
Relation(T1 *obj1, T2 *obj2)
const T2 * getSecond() const
const T1 * getFirst() const
This class is used to wrap a collection of Relations.