Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
ItemFamilySerializeArgs.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/* ItemFamilySerializeArgs.h (C) 2000-2025 */
9/* */
10/* Arguments for the serialization callbacks of entity families. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_ITEMFAMILYSERIALIZEARGS_H
13#define ARCANE_CORE_ITEMFAMILYSERIALIZEARGS_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/ArrayView.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*!
30 * \ingroup Mesh
31 * \brief Arguments for the serialization callbacks of entity families.
32 *
33 * The meaning of the arguments depends on the serialization mode.
34 *
35 * In ISerializer::ModeReserve or ISerializer::ModePut mode:
36 * - rank() is the rank of the destination family
37 * - localIds() contains the local indices of the entities that will be sent
38 * to the destination family.
39 *
40 * In ISerializer::ModeGet mode:
41 * - rank() is the rank of the source family.
42 * - localIds() contains the local indices of the entities that have just
43 * been received.
44 *
45 */
46class ARCANE_CORE_EXPORT ItemFamilySerializeArgs
47{
48 public:
49
50 ItemFamilySerializeArgs(ISerializer* aserializer, Int32 arank,
51 Int32ConstArrayView local_ids, Integer message_index)
52 : m_serializer(aserializer)
53 , m_rank(arank)
54 , m_local_ids(local_ids)
55 , m_message_index(message_index)
56 {}
57
58 public:
59
60 //! Associated serializer
61 ISerializer* serializer() const { return m_serializer; }
62
63 /*!
64 * \brief Rank of the source or destination.
65 *
66 * During serialization, it is the rank of the destination, and during
67 * deserialization it is the rank of the source.
68 */
69 Int32 rank() const { return m_rank; }
70
71 /*!
72 * \brief Local indices of the entities.
73 * During serialization, these are the local indices of the entities sent to
74 * rank \a rank(). During deserialization, these are the local indices
75 * received by rank \a rank().
76 */
77 Int32ConstArrayView localIds() const { return m_local_ids; }
78
79 //! Message index in the list of messages
80 Integer messageIndex() const { return m_message_index; }
81
82 public:
83
84 ISerializer* m_serializer = nullptr;
85 Int32 m_rank = A_NULL_RANK;
86 Int32ConstArrayView m_local_ids;
87 Integer m_message_index = -1;
88};
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
93} // namespace Arcane
94
95/*---------------------------------------------------------------------------*/
96/*---------------------------------------------------------------------------*/
97
98#endif
Declarations of types used in Arcane.
Integer messageIndex() const
Message index in the list of messages.
Int32 rank() const
Rank of the source or destination.
Int32ConstArrayView localIds() const
Local indices of the entities. During serialization, these are the local indices of the entities sent...
ISerializer * serializer() const
Associated serializer.
-- 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.
Definition UtilsTypes.h:482
std::int32_t Int32
Signed integer type of 32 bits.