ATLAS Offline Software
CompareAndPrint.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ATHCONTAINERS_TOOLS_COMPAREANDPRINT_H
6 #define ATHCONTAINERS_TOOLS_COMPAREANDPRINT_H 1
7 
8 //****************************************************************************
9 // Helpers for deleting @c DataVector/List elements.
10 //
11 
12 #include <algorithm> /*sort, unique */
13 #include <typeinfo>
14 
15 namespace DataModel_detail {
23 {
24 public:
31  : m_quiet(quiet) {}
32 
33 
41  template <typename Element>
42  bool operator()(Element* f, Element* s) const
43  {
44  bool areEq = (f == s);
45  if (!m_quiet && areEq && f != 0)
46  warn (typeid (*f), f);
47  return areEq;
48  }
49 
50 
56  // This is defined out-of-line in the cxx file.
57  void warn (const std::type_info& ti, const void* f) const;
58 
59 
60 private:
62  bool m_quiet;
63 };
64 } // namespace DataModel_detail
65 #endif // not ATHCONTAINERS_TOOLS_COMPAREANDPRINT_H
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
DataModel_detail::CompareAndPrint::operator()
bool operator()(Element *f, Element *s) const
Compare two pointers.
Definition: CompareAndPrint.h:42
quiet
bool quiet
Definition: TrigGlobEffCorrValidation.cxx:190
DataModel_detail::CompareAndPrint
Helper for remove_duplicates.
Definition: CompareAndPrint.h:23
DataModel_detail::CompareAndPrint::CompareAndPrint
CompareAndPrint(bool quiet)
Constructor.
Definition: CompareAndPrint.h:30
hist_file_dump.f
f
Definition: hist_file_dump.py:135
DataModel_detail
Definition: CompareAndPrint.h:15
DataModel_detail::CompareAndPrint::warn
void warn(const std::type_info &ti, const void *f) const
Duplicate elements were found; print a warning.
Definition: CompareAndPrint.cxx:26
DataModel_detail::CompareAndPrint::m_quiet
bool m_quiet
Quiet flag.
Definition: CompareAndPrint.h:62