ATLAS Offline Software
Loading...
Searching...
No Matches
Control
AthContainers
AthContainers
tools
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
{
22
class
CompareAndPrint
23
{
24
public
:
30
CompareAndPrint
(
bool
quiet
)
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
quiet
bool quiet
Definition
TrigGlobEffCorrValidation.cxx:190
DataModel_detail::CompareAndPrint::operator()
bool operator()(Element *f, Element *s) const
Compare two pointers.
Definition
CompareAndPrint.h:42
DataModel_detail::CompareAndPrint::m_quiet
bool m_quiet
Quiet flag.
Definition
CompareAndPrint.h:62
DataModel_detail::CompareAndPrint::CompareAndPrint
CompareAndPrint(bool quiet)
Constructor.
Definition
CompareAndPrint.h:30
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
Definition
CompareAndPrint.h:15
Generated on
for ATLAS Offline Software by
1.14.0