Reduce duplicate code with templates
At the moment we have some duplicate codes regarding the different in- and output streams, e.g.:
inline QTextStream& operator<<(QTextStream& s, const TrackPerson& tp)
{
s << tp.nr() << " " << tp.height() << " " << tp.firstFrame() << " " << tp.lastFrame() << " " << tp.colCount() << " " << tp.color();
if (Petrack::trcVersion > 3)
{
s << " " <<tp.getMarkerID();
}
s << " " << tp.size();
s << Qt::endl << tp.commentOneLine() << Qt::endl;
for (int i = 0; i < tp.size(); ++i)
s << tp.at(i) << Qt::endl;
return s;
}
inline std::ostream& operator<<(std::ostream& s, const TrackPerson& tp)
{
s << tp.nr() << " " << tp.height() << " " << tp.firstFrame() << " " << tp.lastFrame() << " " << tp.colCount() << " " << tp.color();
if(Petrack::trcVersion > 3)
{
s << " " << tp.getMarkerID();
}
s << " " << tp.size();
s << std::endl << tp.commentOneLine() << std::endl;
for (int i = 0; i < tp.size(); ++i)
s << tp.at(i) << std::endl;
return s;
}
This should be reduced, as such things tend to differ with time.