Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
ItemLocalIdListView.cc
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2023 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/* ItemLocalIdListView.cc (C) 2000-2023 */
9/* */
10/* Vue sur une liste de ItemLocalId. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/core/ItemLocalIdListView.h"
15
16#include "arcane/utils/Array.h"
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21namespace Arcane::impl
22{
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27std::ostream&
28operator<<(std::ostream& o, const impl::ItemLocalIdListContainerView& lhs)
29{
30 const Int32 n = lhs.size();
31 if (n == 0) {
32 o << "{}";
33 }
34 else {
35 o << "{ " << lhs[0];
36 for (Int32 i = 1; i < n; ++i)
37 o << ", " << lhs[i];
38 o << " }";
39 }
40 return o;
41}
42
43/*---------------------------------------------------------------------------*/
44/*---------------------------------------------------------------------------*/
45}
46
47/*---------------------------------------------------------------------------*/
48/*---------------------------------------------------------------------------*/
49
50namespace Arcane
51{
52
53/*---------------------------------------------------------------------------*/
54/*---------------------------------------------------------------------------*/
55
56bool operator==(const ItemLocalIdListView& lhs, const ItemLocalIdListView& rhs)
57{
58 Int32 size1 = lhs.size();
59 Int32 size2 = rhs.size();
60 if (size1 != size2)
61 return false;
62 for (Int32 i = 0; i < size1; ++i)
63 if (lhs[i] != rhs[i])
64 return false;
65 return true;
66}
67
68/*---------------------------------------------------------------------------*/
69/*---------------------------------------------------------------------------*/
70
71void impl::ItemLocalIdListContainerView::
72fillLocalIds(Array<Int32>& ids) const
73{
74 for( Int32 i=0, n=m_size; i<n; ++i )
75 ids.add(localId(i));
76}
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81// Pour tester l'instantiation de ces classes
82template class ItemLocalIdListViewT<Node>;
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87} // namespace Arcane
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120
std::ostream & operator<<(std::ostream &o, eExecutionPolicy exec_policy)
Affiche le nom de la politique d'exécution.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-