12#ifndef ARCANE_CORE_ARRAY2VARIABLE_H
13#define ARCANE_CORE_ARRAY2VARIABLE_H
17#include "arcane/utils/Array2.h"
19#include "arcane/core/Variable.h"
52 static ARCANE_CORE_EXPORT ThatClass* getReference(
IVariable* var);
61 ARCCORE_DEPRECATED_2021(
"Use valueView() instead")
64 ConstArray2View<T> valueView()
const {
return m_data->
view(); }
65 Array2View<T> valueView() {
return m_data->view(); }
72 void print(std::ostream& o)
const override;
76 const IData*
data()
const override {
return m_data; }
80 ARCANE_CORE_EXPORT
void directResize(
Integer dim1);
82 ARCANE_CORE_EXPORT
void directResizeAndReshape(
const ArrayShape& shape);
83 ARCANE_CORE_EXPORT
void swapValues(ThatClass& rhs);
84 ARCANE_CORE_EXPORT
void fillShape(
ArrayShape& shape);
85 ValueDataType* trueData() {
return m_data; }
89 void _internalResize(
const VariableResizeArgs& resize_args)
override;
94 ValueDataType* m_data =
nullptr;
VariableComparerResults _compareVariable(const VariableComparerArgs &compare_args) final
Comparison of values between variables.
void compact(Int32ConstArrayView old_to_new_ids) override
Compresses the variable's values.
void setIsSynchronized() override
Indicates that the variable is synchronized.
Array2VariableT(const VariableBuildInfo &v, const VariableInfo &vi)
Constructs a variable based on the reference v.
Integer nbElement() const override
Number of elements of the variable.
IData * data() override
Data associated with the variable.
void copyItemsMeanValues(Int32ConstArrayView first_source, Int32ConstArrayView second_source, Int32ConstArrayView destination) override
Copies the mean values of entities numbered first_source and second_source into entities numbered des...
void copyItemsValues(Int32ConstArrayView source, Int32ConstArrayView destination) override
Copies the values of entities numbered source into entities numbered destination.
void synchronize() override
Synchronizes the variable.
const IData * data() const override
Data associated with the variable.
Real allocatedMemory() const override
Memory size (in Bytes) used by the variable.
void setIsSynchronized(const ItemGroup &item_group) override
Indicates that the variable is synchronized on the group item_group.
void print(std::ostream &o) const override
Prints the variable's values to the stream o.
void synchronize(Int32ConstArrayView local_ids) override
Synchronizes the variable on a list of entities.
void shrinkMemory() override
Frees any additional memory allocated for the data.
Class representing a classic 2D array.
View for a constant 2D array.
virtual ConstArray2View< DataType > view() const =0
Constant view on the data.
Interface of a data item.
Parameters necessary for building a variable.
Arguments for VariableComparer methods.
Results of a comparison operation.
Information characterizing a variable.
Variable(const VariableBuildInfo &v, const VariableInfo &vi)
Creates a variable linked to the reference v.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
double Real
Type representing a real number.