12#ifndef ARCANE_CORE_ANYITEM_ANYITEMVARIABLEARRAY_H
13#define ARCANE_CORE_ANYITEM_ANYITEMVARIABLEARRAY_H
17#include "arcane/utils/Exception.h"
19#include "arcane/core/anyitem/AnyItemGlobal.h"
20#include "arcane/core/anyitem/AnyItemGroup.h"
21#include "arcane/core/anyitem/AnyItemLinkFamily.h"
27namespace Arcane::AnyItem
55template <
typename DataType>
67 VariableAdder(VariableArray<DataType>& variable,
const ItemGroup& group)
75 ARCANE_ASSERT((
m_used ==
true), (
"VariableAdder never used"));
79 template <
typename K,
typename T>
82 ARCANE_ASSERT((
m_used ==
false), (
"VariableAdder already used"));
89 template <
typename K,
typename T>
92 ARCANE_ASSERT((
m_used ==
false), (
"VariableAdder already used"));
168 template <
typename T>
171 return VariableAdder(*
this, group);
210 ARCANE_ASSERT((old_size <
m_family.groupSize()), (
"Old size greater than new size!"));
233 inline void _insertInternalVariable(ItemGroup group, IVariable* v)
AnyItem family (flyweight pattern) Aggregation of groups to describe variables / partial variables Co...
bool isPartial(const ItemGroup &group) const
Returns true if the group is associated with a partial variable.
void removeObserver(IFamilyObserver &observer) const
Remove an observer.
void registerObserver(IFamilyObserver &observer) const
Register an observer.
Integer groupIndex(const ItemGroup &group) const
Position of the group in the family.
AnyItem family observer interface.
Integer groupIndex() const
Identifier of the group associated with the item referenced by this LinkData.
Integer varIndex() const
LocalId identifier of the item referenced in its original IItemFamily.
Tool for adding a variable to a group.
const ItemGroup & m_group
Variable group.
VariableArray< DataType > & m_variable
AnyItem variable.
void operator<<(MeshVariableArrayRefT< K, T > &v)
Binding of a variable.
void operator<<(MeshPartialVariableArrayRefT< K, T > &v)
Binding of a partial variable.
bool m_used
Indicator of Adder usage.
Aggregated variable array of arbitrary types (no variable arrays) WARNING Arcane variables must be re...
const Family m_family
AnyItem family of groups.
ArrayView< DataType > operator[](const LinkFamily::LinkData &item)
Direct accessor by a LinkFamily element (LinkData).
void notifyFamilyIsIncreased()
Notification of family enlargement.
const Family & family() const
Accessor to the family.
ArrayView< DataType > operator[](const Group::BlockItemEnumerator &item)
Direct accessor by an AnyItem enumerator.
ConstArray2View< DataType > valuesAtGroup(const Integer igrp) const
Raw data associated with a group identified relative to its family.
Array2View< DataType > valuesAtGroup(const Integer igrp)
Raw data associated with a group identified relative to its family.
ConstArrayView< DataType > operator[](const Group::BlockItemEnumerator &item) const
Direct accessor by an AnyItem enumerator.
ConstArrayView< IVariable * > variables() const
Array of variables.
void notifyFamilyIsInvalidate()
Notification of family invalidation.
VariableAdder operator[](const ItemGroup &group)
Addition of a variable for a group.
Arcane::UniqueArray< Array2View< DataType > > m_values
Container of generic variables.
Arcane::UniqueArray< IVariable * > m_variables
Container of variables.
ConstArrayView< DataType > operator[](const LinkFamily::LinkData &item) const
Direct accessor by a LinkFamily element (LinkData).
Mutable view for a 2D array.
Modifiable view of an array of type T.
View for a constant 2D array.
Constant view of an array of type T.
Exception when a fatal error has occurred.
Reference to a group of a given kind.
const String & name() const
Group name.
Scalar partial variable on a mesh entity type.
Array variable on a mesh entity type.
1D data vector with value semantics (STL style).
IVariable * variable() const
Associated variable.
Int32 Integer
Type representing an integer.
void arcaneCallFunctionAndTerminateIfThrow(std::function< void()> function)
Calls the function function and calls std::terminate() if an exception occurs.