Arcane
v3.14.10.0
Documentation utilisateur
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
/*---------------------------------------------------------------------------*/
29
/*!
30
* \internal
31
* \brief Verrou sur une variable tableau.
32
* \deprecated Ne plus utiliser
33
*/
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::IVariable
Definition
IVariable.h:54
Arcane::IVariable::syncReferences
virtual void syncReferences()=0
Synchronise les références.
Arcane::VariableRefArrayLockT
Definition
VariableRefArrayLock.h:36
Arccore::AbstractArray::size
Integer size() const
Nombre d'éléments du vecteur.
Definition
arccore/src/collections/arccore/collections/Array.h:421
Arccore::Array
Classe de base des vecteurs 1D de données.
Definition
arccore/src/collections/arccore/collections/Array.h:988
Arccore::Array::data
const T * data() const
Accès à la racine du tableau hors toute protection.
Definition
arccore/src/collections/arccore/collections/Array.h:1385
Arcane
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Definition
AbstractCaseDocumentVisitor.cc:20
arcane
core
VariableRefArrayLock.h
Généré le Lundi 18 Novembre 2024 02:56:50 pour Arcane par
1.9.8