12#ifndef ARCANE_CORE_MESHPARTIALVARIABLEARRAYREF_H
13#define ARCANE_CORE_MESHPARTIALVARIABLEARRAYREF_H
17#include "arcane/utils/FatalErrorException.h"
19#include "arcane/core/MeshVariableRef.h"
20#include "arcane/core/PrivateVariableArray.h"
22#include "arcane/core/ItemGroupRangeIterator.h"
23#include "arcane/core/ItemPairEnumerator.h"
24#include "arcane/core/GroupIndexTable.h"
39template <
typename DataTypeT>
41:
public PrivateVariableArrayT<DataTypeT>
45 typedef DataTypeT DataType;
52 typedef PrivateVariableArrayT<DataType> BaseClass;
53 typedef typename BaseClass::PrivatePartType PrivatePartType;
76 ARCANE_CORE_EXPORT
void fill(
const DataType& value);
78 ARCANE_CORE_EXPORT
void internalSetUsed(
bool v);
82 ConstArrayType operator[](
const Item& i)
const
84 ARCANE_CHECK_VALID_ITEM_AND_GROUP_KIND(i);
85 ARCANE_ASSERT((m_table.isUsed()), (
"GroupIndexTable expired"));
87 return this->m_view[table[i.
localId()]];
89 ArrayType operator[](
const Item& i)
91 ARCANE_CHECK_VALID_ITEM_AND_GROUP_KIND(i);
92 ARCANE_ASSERT((m_table.isUsed()), (
"GroupIndexTable expired"));
94 return this->m_view[table[i.
localId()]];
96 ConstArrayType operator[](
const ItemGroupRangeIterator& i)
const
98 ARCANE_CHECK_VALID_ITEM_AND_GROUP_KIND(i);
99 return this->m_view[i.index()];
101 ArrayType operator[](
const ItemGroupRangeIterator& i)
103 ARCANE_CHECK_VALID_ITEM_AND_GROUP_KIND(i);
104 return this->m_view[i.index()];
106 ConstArrayType operator[](
const ItemEnumerator& i)
const
108 ARCANE_CHECK_ENUMERATOR(i, this->itemGroup());
109 return this->m_view[i.index()];
111 ArrayType operator[](
const ItemEnumerator& i)
113 ARCANE_CHECK_ENUMERATOR(i, this->itemGroup());
114 return this->m_view[i.index()];
116 ConstArrayType operator[](ItemEnumeratorIndex i)
const
118 return this->m_view[i.index()];
120 ArrayType operator[](ItemEnumeratorIndex i)
122 return this->m_view[i.index()];
147template <
typename ItemTypeT,
typename DataTypeT>
153 typedef DataTypeT DataType;
154 typedef ItemTypeT ItemType;
182 ConstArrayType operator[](
const ItemLocalIdType& i)
const
184 ARCANE_ASSERT((this->m_table.isUsed()), (
"GroupIndexTable expired"));
186 return this->m_view[table[i.asInt32()]];
188 ArrayType operator[](
const ItemLocalIdType& i)
190 ARCANE_ASSERT((this->m_table.isUsed()), (
"GroupIndexTable expired"));
192 return this->m_view[table[i.asInt32()]];
194 ConstArrayType operator[](
const ItemGroupRangeIteratorT<ItemType>& i)
const
196 return this->m_view[i.index()];
198 ArrayType operator[](
const ItemGroupRangeIteratorT<ItemType>& i)
200 return this->m_view[i.index()];
202 ConstArrayType operator[](
const ItemPairEnumeratorSubT<ItemType>& i)
const
204 return this->m_view[i.index()];
206 ArrayType operator[](
const ItemPairEnumeratorSubT<ItemType>& i)
208 return this->m_view[i.index()];
210 ConstArrayType operator[](
const ItemEnumeratorT<ItemType>& i)
const
212 ARCANE_CHECK_ENUMERATOR(i, this->
itemGroup());
213 return this->m_view[i.index()];
215 ArrayType operator[](
const ItemEnumeratorT<ItemType>& i)
217 ARCANE_CHECK_ENUMERATOR(i, this->
itemGroup());
218 return this->m_view[i.index()];
220 ConstArrayType operator[](ItemEnumeratorIndexT<ItemType> i)
const
222 return this->m_view[i.index()];
224 ArrayType operator[](ItemEnumeratorIndexT<ItemType> i)
226 return this->m_view[i.index()];
Modifiable view of an array of type T.
Constant view of an array of type T.
Base class of a hash table between group items and their positions in the table.
Index of an ItemType entity in a variable.
ItemPartialVariableArrayRefT(const VariableBuildInfo &vb, eItemKind ik)
Constructs a reference to the variable specified in vb.
GroupIndexTableView tableView() const
View of the group indirection table.
void operator=(const ItemPartialVariableArrayRefT< DataType > &rhs)
Copy assignment operator.
ItemPartialVariableArrayRefT(IVariable *var)
Constructs a reference from var.
ItemPartialVariableArrayRefT(const ItemPartialVariableArrayRefT< DataType > &rhs)
Constructs a reference from rhs.
Characteristics of mesh elements.
Base class for a mesh element.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
void refersTo(const MeshPartialVariableArrayRefT< ItemType, DataType > &rhs)
Positions the instance reference to the variable rhs.
MeshPartialVariableArrayRefT(const VariableBuildInfo &vb)
Constructs a reference to the variable specified in vb.
MeshPartialVariableArrayRefT(const MeshPartialVariableArrayRefT< ItemType, DataType > &rhs)
Constructs a reference from rhs.
GroupType itemGroup() const
Group associated with the quantity.
2D data vector with value semantics (STL style).
Parameters necessary for building a variable.
Variable factory registrar.
Information characterizing a variable.
Information characterizing the type of a variable.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
eItemKind
Mesh entity type.