Arcane  v3.16.4.0
Documentation utilisateur
Chargement...
Recherche...
Aucune correspondance
VarRefEnumerator.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* VarRefEnumerator.h (C) 2000-2025 */
9/* */
10/* Classe parcourant les références d'une Variable. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_VARREFENUMERATOR_H
13#define ARCANE_CORE_VARREFENUMERATOR_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/IVariable.h"
18#include "arcane/core/VariableRef.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29class VarRefEnumerator
30{
31 public:
32
33 VarRefEnumerator(const IVariable* vp)
34 : m_vref(vp->firstReference())
35 {
36 }
37 void operator++()
38 {
39 m_vref = m_vref->nextReference();
40 }
41 VariableRef* operator*()
42 {
43 return m_vref;
44 }
45 bool hasNext() const
46 {
47 return m_vref;
48 }
49
50 private:
51
52 VariableRef* m_vref = nullptr;
53};
54
55/*---------------------------------------------------------------------------*/
56/*---------------------------------------------------------------------------*/
57
58} // namespace Arcane
59
60/*---------------------------------------------------------------------------*/
61/*---------------------------------------------------------------------------*/
62
63#endif
virtual VariableRef * firstReference() const =0
Première réference (ou null) sur cette variable.
Référence à une variable.
Definition VariableRef.h:56
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-