Arcane
4.1.12.0
User documentation
Loading...
Searching...
No Matches
VarRefEnumerator.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
/* VarRefEnumerator.h (C) 2000-2025 */
9
/* */
10
/* Class iterating over a Variable's references. */
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
23
namespace
Arcane
24
{
25
26
/*---------------------------------------------------------------------------*/
27
/*---------------------------------------------------------------------------*/
28
29
class
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
Arcane::IVariable
Interface of a variable.
Definition
IVariable.h:40
Arcane::IVariable::firstReference
virtual VariableRef * firstReference() const =0
First reference (or null) on this variable.
Arcane::VariableRef
Reference to a variable.
Definition
VariableRef.h:56
Arcane
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Definition
AbstractCaseDocumentVisitor.cc:21
arcane
core
VarRefEnumerator.h
Generated on
for Arcane by
1.16.1