Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
MessageSourceInfo.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/* MessageSourceInfo.h (C) 2000-2025 */
9/* */
10/* Information about the source of a message. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCCORE_MESSAGEPASSING_MESSAGESOURCEINFO_H
13#define ARCCORE_MESSAGEPASSING_MESSAGESOURCEINFO_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arccore/message_passing/MessageTag.h"
18#include "arccore/message_passing/MessageRank.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
36class ARCCORE_MESSAGEPASSING_EXPORT MessageSourceInfo
37{
38 public:
39
41 MessageSourceInfo() = default;
42
49 : m_rank(rank)
50 , m_tag(tag)
51 , m_size(size)
52 {}
53
54 public:
55
57 MessageRank rank() const { return m_rank; }
58
60 void setRank(MessageRank rank) { m_rank = rank; }
61
63 MessageTag tag() const { return m_tag; }
64
66 void setTag(MessageTag tag) { m_tag = tag; }
67
69 Int64 size() const { return m_size; }
70
72 void setSize(Int64 size) { m_size = size; }
73
75 bool isValid() const { return !m_rank.isNull() && !m_tag.isNull(); }
76
77 private:
78
79 MessageRank m_rank;
80 MessageTag m_tag;
81 Int64 m_size = 0;
82};
83
84/*---------------------------------------------------------------------------*/
85/*---------------------------------------------------------------------------*/
86
87} // namespace Arcane::MessagePassing
88
89/*---------------------------------------------------------------------------*/
90/*---------------------------------------------------------------------------*/
91
92#endif
MessageSourceInfo()=default
Creates a source corresponding to no message (isValid()==false).
void setTag(MessageTag tag)
Sets the message tag.
MessageSourceInfo(MessageRank rank, MessageTag tag, Int64 size)
Creates a source corresponding to rank rank and tag tag.
void setSize(Int64 size)
Sets the message size.
MessageRank rank() const
Source rank.
bool isValid() const
Indicates if the source is valid.
void setRank(MessageRank rank)
Sets the source rank.
Declarations of types and methods used by message exchange mechanisms.
std::int64_t Int64
Signed integer type of 64 bits.