Arcane
v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
VariableRefArrayLock.h
1
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2
//-----------------------------------------------------------------------------
3
// Copyright 2000-2022 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
/* VariableRefArrayLock.h (C) 2000-2021 */
9
/* */
10
/* Verrou sur une variable tableau. */
11
/*---------------------------------------------------------------------------*/
12
#ifndef ARCANE_VARIABLEREFARRAYLOCK_H
13
#define ARCANE_VARIABLEREFARRAYLOCK_H
14
/*---------------------------------------------------------------------------*/
15
/*---------------------------------------------------------------------------*/
16
17
#include "arcane/utils/Array.h"
18
19
#include "arcane/IVariable.h"
20
21
/*---------------------------------------------------------------------------*/
22
/*---------------------------------------------------------------------------*/
23
24
namespace
Arcane
25
{
26
27
/*---------------------------------------------------------------------------*/
28
/*---------------------------------------------------------------------------*/
34
template
<
typename
DataType>
35
class
VariableRefArrayLockT
36
{
37
public
:
38
39
typedef
Array<DataType>
ValueType
;
40
typedef
VariableRefArrayLockT<DataType>
ThatClass
;
41
42
public
:
43
44
VariableRefArrayLockT
(
ValueType
& v,
IVariable
*
var
)
45
: m_value(v), m_variable(
var
), m_saved_ptr(v.data()), m_saved_size(v.size())
46
{
47
}
48
49
~VariableRefArrayLockT
()
50
{
51
if
(m_value.data()!=m_saved_ptr || m_value.size()!=m_saved_size)
52
m_variable->
syncReferences
();
53
}
54
55
public
:
56
57
VariableRefArrayLockT
(
const
VariableRefArrayLockT<DataType>
&
rhs
) =
default
;
58
ThatClass
& operator=(
const
ThatClass
&
rhs
) =
default
;
59
60
public
:
61
62
ARCCORE_DEPRECATED_2021(
"This class is deprecated"
)
63
ValueType
& value() {
return
m_value; }
64
65
private
:
66
67
ValueType
& m_value;
68
IVariable
* m_variable;
69
DataType* m_saved_ptr;
70
Integer m_saved_size;
71
};
72
73
/*---------------------------------------------------------------------------*/
74
/*---------------------------------------------------------------------------*/
75
76
}
// End namespace Arcane
77
78
/*---------------------------------------------------------------------------*/
79
/*---------------------------------------------------------------------------*/
80
81
#endif
Arcane::Array
Tableau d'items de types quelconques.
Definition
AnyItemArray.h:55
Arcane::IVariable
Interface d'une variable.
Definition
IVariable.h:54
Arcane::IVariable::syncReferences
virtual void syncReferences()=0
Synchronise les références.
Arcane::LimaWrapper
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition
Lima.cc:120
Arcane::VariableRefArrayLockT
Verrou sur une variable tableau.
Definition
VariableRefArrayLock.h:36
Arcane
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Definition
AcceleratorGlobal.h:36
arcane
core
VariableRefArrayLock.h
Généré le Lundi 18 Novembre 2024 03:01:09 pour Arcane par
1.9.8