+namespace
+{
+ // helper function for std:sort, implements an operator<
+ bool SortComponentStatisticsById(const AliHLTComponentStatistics& a, const AliHLTComponentStatistics& b)
+ {
+ return a.fId<b.fId;
+ }
+
+ // helper function for std:sort
+ bool SortComponentStatisticsDescendingByLevel(const AliHLTComponentStatistics& a, const AliHLTComponentStatistics& b)
+ {
+ return a.fId>b.fId;
+ }
+
+ // helper class to define operator== between AliHLTComponentStatistics and AliHLTComponentStatistics.fId
+ class AliHLTComponentStatisticsId {
+ public:
+ AliHLTComponentStatisticsId(AliHLTUInt32_t id) : fId(id) {}
+ AliHLTComponentStatisticsId(const AliHLTComponentStatisticsId& src) : fId(src.fId) {}
+ AliHLTComponentStatisticsId& operator=(const AliHLTComponentStatisticsId& src) {
+ if (this==&src) return *this;
+ fId=src.fId; return *this;
+ }
+ bool operator==(const AliHLTComponentStatistics& a) const {return a.fId==fId;}
+ private:
+ AliHLTComponentStatisticsId();
+ AliHLTUInt32_t fId;
+ };
+
+ // operator for std::find of AliHLTComponentStatistics by id
+ bool operator==(const AliHLTComponentStatistics& a, const AliHLTComponentStatisticsId& b)
+ {
+ return b==a;
+ }
+
+ bool AliHLTComponentStatisticsCompareIds(const AliHLTComponentStatistics& a, const AliHLTComponentStatistics& b)
+ {
+ return a.fId==b.fId;
+ }
+
+ // helper class to define operator== between AliHLTComponentBlockData and AliHLTComponentBlockData.fSpecification
+ class AliHLTComponentBlockDataSpecification {
+ public:
+ AliHLTComponentBlockDataSpecification(AliHLTUInt32_t specification) : fSpecification(specification) {}
+ AliHLTComponentBlockDataSpecification(const AliHLTComponentBlockDataSpecification& src) : fSpecification(src.fSpecification) {}
+ AliHLTComponentBlockDataSpecification& operator=(const AliHLTComponentBlockDataSpecification& src) {
+ if (this==&src) return *this;
+ fSpecification=src.fSpecification; return *this;
+ }
+ bool operator==(const AliHLTComponentBlockData& bd) const {return bd.fSpecification==fSpecification;}
+ private:
+ AliHLTComponentBlockDataSpecification();
+ AliHLTUInt32_t fSpecification;
+ };
+
+ // operator for std::find of AliHLTComponentBlockData by specification
+ bool operator==(const AliHLTComponentBlockData& bd, const AliHLTComponentBlockDataSpecification& spec)
+ {
+ return spec==bd;
+ }
+
+ // operator for std::find
+ bool operator==(const AliHLTComponentBlockData& a, const AliHLTComponentBlockData& b)
+ {
+ if (!MatchExactly(a.fDataType,b.fDataType)) return false;
+ return a.fSpecification==b.fSpecification;
+ }
+
+} // end of namespace
+