6#include "GaudiKernel/ClassID.h"
7#include "GaudiKernel/ContainedObject.h"
24static const CLID CLID_Relation = 5100;
29template <
class T1,
class T2>
34template <
class T1,
class T2>
40 static const CLID&
classID() {
return CLID_Relation; }
43 Relation(T1* obj1, T2* obj2): m_first(obj1), m_second(obj2) {}
44 Relation(T1* obj1, T2* obj2, std::string info);
45 Relation(T1* obj1, T2* obj2, std::vector<std::string> infos);
69 std::vector<std::string> m_infos;
71 void setFirst(T1* obj) {m_first.
setData(obj);}
72 void setSecond(T2 *obj) {m_second.
setData(obj);}
78template <
class T1,
class T2>
80 m_first(obj1), m_second(obj2), m_infos(1,info) {}
83template <
class T1,
class T2>
85 m_first(obj1), m_second(obj2), m_infos(infos) {}
89template <
class T1,
class T2>
94 m_infos.push_back(inf);
98template <
class T1,
class T2>
108template <
class T1,
class T2>
111 s <<
" Base class Relation"
112 <<
"\n First Column: ";
114 s <<
"\n Second Column: ";
116 s <<
"\n Additional Information: ";
118 std::vector<std::string>::const_iterator i;
119 for(i = m_infos.begin(); i != m_infos.end(); i++)
void toStream(std::ostream &s) const
Fill the ASCII output stream.
const T1 * getData() const
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.