14#include "arcane/core/ISerializer.h"
15#include "arcane/core/IItemFamily.h"
16#include "arcane/core/ItemInfoListView.h"
17#include "arcane/core/Item.h"
19#include "arcane/mesh/IndirectItemFamilySerializer.h"
30IndirectItemFamilySerializer::
31IndirectItemFamilySerializer(IItemFamily* family)
32: TraceAccessor(family->traceMng())
40void IndirectItemFamilySerializer::
46 switch (sbuf->
mode()) {
47 case ISerializer::ModeReserve:
55 for (
Integer z = 0; z < nb_item; ++z) {
56 Item item = items_internal[local_ids[z]];
57 particle_unique_ids[z] = item.
uniqueId().asInt64();
59 sbuf->
putSpan(particle_unique_ids);
71void IndirectItemFamilySerializer::
77 unique_ids.
resize(nb_item);
81 Int32Array* work_local_id = (local_ids) ? local_ids : &temporary_local_ids;
82 work_local_id->
resize(nb_item);
84 m_family->itemsUniqueIdToLocalId(*work_local_id, unique_ids,
true);
void resize(Int64 s)
Changes the number of elements in the array to s.
constexpr Integer size() const noexcept
Number of elements in the array.
Interface of an entity family.
void reserveInt64(Int64 n)
Reserve for n Int64.
@ ModePut
The serializer expects reserve().
@ ModeGet
The serializer expects get().
virtual Int64 getInt64()=0
Retrieve a size.
virtual void putSpan(Span< const Real > values)
Add the array values.
virtual eMode mode() const =0
Current operating mode.
virtual void getSpan(Span< Real > values)
Retrieve the array values.
virtual void reserveSpan(eBasicDataType dt, Int64 n)=0
Reserves memory for n values of dt.
virtual void putInt64(Int64 value)=0
Add the integer value.
View of a list to obtain information about entities.
Base class for a mesh element.
ItemUniqueId uniqueId() const
Unique identifier across all domains.
void deserializeItems(ISerializer *buf, Int32Array *local_ids) override
Deserializes the entities of the family family() from buf.
UniqueArray< Int64 > Int64UniqueArray
Dynamic 1D array of 64-bit integers.
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
@ Int64
64-bit integer data type
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.