12#ifndef ARCCORE_MESSAGEPASSING_POINTTOPOINTINFO_H
13#define ARCCORE_MESSAGEPASSING_POINTTOPOINTINFO_H
17#include "arccore/message_passing/MessageId.h"
18#include "arccore/message_passing/MessageTag.h"
19#include "arccore/message_passing/MessageRank.h"
73 : m_destination_rank(dest_rank)
74 , m_type(Type::T_RankTag)
80 : m_destination_rank(dest_rank)
81 , m_is_blocking(blocking_type == Blocking)
82 , m_type(Type::T_RankTag)
87 : m_destination_rank(dest_rank)
89 , m_type(Type::T_RankTag)
95 : m_destination_rank(dest_rank)
97 , m_is_blocking(blocking_type == Blocking)
98 , m_type(Type::T_RankTag)
103 : m_message_id(message_id)
104 , m_type(Type::T_MessageId)
106 _setInfosFromMessageId();
111 : m_message_id(message_id)
112 , m_is_blocking(blocking_type == Blocking)
113 , m_type(Type::T_MessageId)
115 _setInfosFromMessageId();
124 ARCCORE_DEPRECATED_REASON(
"Y2022: This constructor is internal to Arcane and deprecated")
126 : m_emiter_rank(emiter_rank)
127 , m_destination_rank(dest_rank)
128 , m_is_blocking(blocking_type == Blocking)
129 , m_type(Type::T_RankTag)
133 ARCCORE_DEPRECATED_REASON(
"Y2022: This constructor is internal to Arcane and deprecated")
135 : m_emiter_rank(emiter_rank)
136 , m_destination_rank(dest_rank)
138 , m_type(Type::T_RankTag)
142 ARCCORE_DEPRECATED_REASON(
"Y2022: This constructor is internal to Arcane and deprecated")
144 : m_emiter_rank(emiter_rank)
145 , m_destination_rank(dest_rank)
146 , m_type(Type::T_RankTag)
157 : m_emiter_rank(emiter_rank)
158 , m_destination_rank(dest_rank)
160 , m_is_blocking(blocking_type == Blocking)
161 , m_type(Type::T_RankTag)
168 m_is_blocking = is_blocking;
176 bool isRankTag()
const {
return m_type == Type::T_RankTag; }
182 m_type = Type::T_MessageId;
183 m_message_id = message_id;
184 _setInfosFromMessageId();
189 m_type = Type::T_RankTag;
200 m_destination_rank = rank;
201 MessageId::SourceInfo si = m_message_id.sourceInfo();
203 m_message_id.setSourceInfo(si);
217 MessageId::SourceInfo si = m_message_id.sourceInfo();
219 m_message_id.setSourceInfo(si);
222 void print(std::ostream& o)
const;
235 if (m_type == Type::T_Null)
237 if (m_type == Type::T_MessageId)
238 return m_message_id.isValid();
239 if (m_type == Type::T_RankTag)
247 ARCCORE_DEPRECATED_REASON(
"Y2022: Use emiterRank() instead")
251 ARCCORE_DEPRECATED_REASON(
"Y2022: Use setEmiterRank() instead")
260 bool m_is_blocking =
true;
261 Type m_type = Type::T_Null;
263 void _setInfosFromMessageId()
MessageSourceInfo sourceInfo() const
Information about the message source;.
MessageTag tag() const
Message tag.
void setTag(MessageTag tag)
Sets the message tag.
MessageRank rank() const
Source rank.
void setRank(MessageRank rank)
Sets the source rank.
static MessageTag defaultTag()
Default tag for send/receive without tag argument.
Information for sending/receiving a point-to-point message.
MessageRank emiterRank() const
Message sender rank.
MessageId messageId() const
Message identifier.
PointToPointMessageInfo(MessageId message_id, eBlockingType blocking_type)
Message associated with message_id with blocking mode blocking_type.
void setEmiterRank(MessageRank rank)
Positions the message sender rank.
PointToPointMessageInfo(MessageRank dest_rank, MessageTag tag)
Blocking message with tag tag and destination rank.
MessageRank sourceRank() const
Message origin rank.
void setDestinationRank(MessageRank rank)
Positions the message destination rank.
void setMessageId(const MessageId &message_id)
Positions the message identifier and changes the message type.
MessageTag tag() const
Message tag.
void print(std::ostream &o) const
Prints the message.
PointToPointMessageInfo()
Null message.
bool isBlocking() const
Indicates if the message is blocking.
void setSourceRank(MessageRank rank)
Positions the message origin rank.
void setRankTag(MessageRank rank, MessageTag tag)
Positions the message destination rank and tag and changes the message type.
bool isRankTag() const
True if the instance was created with a pair (rank,tag). In this case rank() and tag() are valid.
void setTag(MessageTag tag)
Positions the message tag.
PointToPointMessageInfo(MessageRank dest_rank, eBlockingType blocking_type)
Message with default tag, destination dest_rank, and blocking.
PointToPointMessageInfo(MessageRank dest_rank)
Blocking message with default tag and destination rank rank.
PointToPointMessageInfo(MessageId message_id)
Blocking message associated with message_id.
bool isMessageId() const
True if the instance was created with a MessageId. In this case messageId() is valid.
MessageRank destinationRank() const
Message destination rank.
PointToPointMessageInfo(MessageRank dest_rank, MessageTag tag, eBlockingType blocking_type)
Message with tag tag, destination dest_rank, and blocking.
Declarations of types and methods used by message exchange mechanisms.
eBlockingType
Type indicating whether a message is blocking or not.