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
24namespace Arcane
25{
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29/*!
30 * \internal
31 * \brief Verrou sur une variable tableau.
32 * \deprecated Ne plus utiliser
33 */
34template<typename DataType>
36{
37 public:
38
40 typedef VariableRefArrayLockT<DataType> ThatClass;
41
42 public:
43
45 : m_value(v), m_variable(var), m_saved_ptr(v.data()), m_saved_size(v.size())
46 {
47 }
48
50 {
51 if (m_value.data()!=m_saved_ptr || m_value.size()!=m_saved_size)
52 m_variable->syncReferences();
53 }
54
55 public:
56
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
virtual void syncReferences()=0
Synchronise les références.
Integer size() const
Nombre d'éléments du vecteur.
Classe de base des vecteurs 1D de données.
const T * data() const
Accès à la racine du tableau hors toute protection.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-