Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IItemFamilySerializer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IItemFamilySerializer.h (C) 2011-2024 */
9/* */
10/* Manages the serialization/deserialization of entities in a family. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IITEMFAMILYSERIALIZER_H
13#define ARCANE_CORE_IITEMFAMILYSERIALIZER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
18
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane
25{
26class IItemFamily;
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31/*!
32 * \brief Manages the serialization/deserialization of entities in a family.
33 */
34class ARCANE_CORE_EXPORT IItemFamilySerializer
35{
36 public:
37
38 virtual ~IItemFamilySerializer() = default;
39
40 public:
41
42 /*!
43 * \brief Serializes the entities of the family \a family() into \a buf.
44 *
45 * In 'Put' or 'Reserve' mode, \a items contains the local cell numbers.
46 * In 'Get' mode, it calls \a deserializeItems() and \a items is unused.
47 */
48 virtual void serializeItems(ISerializer* buf, Int32ConstArrayView items) = 0;
49
50 /*!
51 * \brief Deserializes the entities of the family \a family() from \a buf.
52 *
53 * If \a items_lid is not null, it contains the local numbers
54 * of the deserialized cells in return.
55 */
56 virtual void deserializeItems(ISerializer* buf, Int32Array* items_lid) = 0;
57
58 /*!
59 * \brief Serializes the relations of the entities of the family \a family() into \a buf.
60 *
61 * In 'Put' or 'Reserve' mode, \a items contains the local cell numbers.
62 * In 'Get' mode, it calls \a deserializeItemRelations() and \a items is unused.
63 */
65
66 /*!
67 * \brief Deserializes the relations of the entities of the family \a family() from \a buf.
68 *
69 * If \a items_lid is not null, it contains the local numbers
70 * of the cells whose relations have been deserialized in return.
71 */
72 virtual void deserializeItemRelations(ISerializer* buf, Int32Array* items_lid) = 0;
73
74 //! Associated family
75 virtual IItemFamily* family() const = 0;
76};
77
78/*---------------------------------------------------------------------------*/
79/*---------------------------------------------------------------------------*/
80
81} // namespace Arcane
82
83/*---------------------------------------------------------------------------*/
84/*---------------------------------------------------------------------------*/
85
86#endif
Declarations of Arcane's general types.
Manages the serialization/deserialization of entities in a family.
virtual void serializeItemRelations(ISerializer *buf, Int32ConstArrayView items)=0
Serializes the relations of the entities of the family family() into buf.
virtual void deserializeItems(ISerializer *buf, Int32Array *items_lid)=0
Deserializes the entities of the family family() from buf.
virtual IItemFamily * family() const =0
Associated family.
virtual void deserializeItemRelations(ISerializer *buf, Int32Array *items_lid)=0
Deserializes the relations of the entities of the family family() from buf.
virtual void serializeItems(ISerializer *buf, Int32ConstArrayView items)=0
Serializes the entities of the family family() into buf.
Interface of an entity family.
Definition IItemFamily.h:83
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
Definition UtilsTypes.h:127