14#include "arcane/utils/ITraceMng.h"
15#include "arcane/utils/CheckedConvert.h"
17#include "arcane/IParallelMng.h"
18#include "arcane/MeshPartInfo.h"
20#include "arcane/mesh/ItemData.h"
32serialize(ISerializer* buffer)
34 switch(buffer->mode()){
35 case ISerializer::ModeReserve:
37 buffer->reserve(m_item_family->name());
38 buffer->reserve(
itemKindName(m_item_family->itemKind()));
40 buffer->reserveSpan(
DT_Int32,m_nb_items);
41 buffer->reserveSpan(
DT_Int64,m_item_infos.size());
46 buffer->put(m_item_family->name());
48 buffer->putInt64(m_nb_items);
49 buffer->putInt64(m_item_infos.size());
50 buffer->putSpan(m_item_owners);
51 buffer->putSpan(m_item_infos);
56 deserialize(buffer,m_item_family->mesh());
66deserialize(ISerializer* buffer, IMesh* mesh)
68 _deserialize(buffer,mesh);
70 _internal_item_lids.resize(m_nb_items);
71 m_item_lids = _internal_item_lids;
78deserialize(ISerializer* buffer, IMesh* mesh,
Int32Array& item_lids)
80 _deserialize(buffer,mesh);
81 item_lids.resize(m_nb_items);
82 m_item_lids = item_lids;
90_deserialize(ISerializer* buffer, IMesh* mesh)
93 (
"Impossible to deserialize a buffer not in ModeGet. In ItemData::deserialize.Exiting"))
95 buffer->get(family_name);
96 String item_kind_name;
97 buffer->get(item_kind_name);
98 std::istringstream iss(item_kind_name.localstr());
101 m_item_family = mesh->findItemFamily(family_kind,family_name,false);
102 m_item_family_modifier = mesh->findItemFamilyModifier(family_kind,family_name);
103 m_nb_items = CheckedConvert::toInt32(buffer->getInt64());
104 m_item_owners.resize(m_nb_items);
105 m_item_infos.resize(buffer->getInt64());
106 buffer->getSpan(m_item_owners);
107 buffer->getSpan(m_item_infos);
108 m_subdomain_id = mesh->meshPartInfo().partRank();
@ ModePut
Le sérialiseur attend des reserve()
@ ModeGet
Le sérialiseur attend des get()
eItemKind
Genre d'entité de maillage.
const char * itemKindName(eItemKind kind)
Nom du genre d'entité.
Array< Int32 > Int32Array
Tableau dynamique à une dimension d'entiers 32 bits.
@ DT_Int32
Donnée de type entier 32 bits.
@ DT_Int64
Donnée de type entier 64 bits.