Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
NameComparer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* NameComparer.h (C) 2000-2006 */
9/* */
10/* Utility class for destroying objects allocated by new. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_UTILS_NAMECOMPARER_H
13#define ARCANE_UTILS_NAMECOMPARER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19#include "arcane/utils/String.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
41class NameComparer
42{
43 public:
44
45 NameComparer(const String& s)
46 : m_name(s)
47 {}
48
49 public:
50
51 template <typename U> inline bool
52 operator()(const U* ptr) const
53 {
54 return ptr->name() == m_name;
55 }
56
57 private:
58
59 String m_name;
60};
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
65} // namespace Arcane
66
67/*---------------------------------------------------------------------------*/
68/*---------------------------------------------------------------------------*/
69
70#endif
Arcane configuration file.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --