Public Member Functions | Friends | List of all members
ucxx::TagProbeInfo Class Reference

Information about probed tag message. More...

#include <tag_probe.h>

Public Member Functions

 TagProbeInfo (const TagProbeInfo &)=delete
 
TagProbeInfooperator= (TagProbeInfo const &)=delete
 
 TagProbeInfo (TagProbeInfo &&o)=delete
 
TagProbeInfooperator= (TagProbeInfo &&o)=delete
 
bool isMatched () const
 Check if a message was matched. More...
 
const TagRecvInfogetInfo () const
 Get tag receive information. More...
 
ucp_tag_message_h getHandle () const
 Get the message handle. More...
 
ucp_tag_message_h releaseHandle () const
 Release the message handle. More...
 

Friends

class RequestTag
 
std::shared_ptr< TagProbeInfocreateTagProbeInfo ()
 Constructor for shared_ptr<ucxx::TagProbeInfo>. More...
 
std::shared_ptr< TagProbeInfocreateTagProbeInfo (const ucp_tag_recv_info_t &info, ucp_tag_message_h handle)
 Constructor for shared_ptr<ucxx::TagProbeInfo>. More...
 

Detailed Description

Information about probed tag message.

Contains complete information about a probed tag message, including whether a message was matched, the tag receive information, and the message handle for efficient reception when tagProbe() is called with remove=true.

Warning
Callers must check isMatched() before calling getInfo() or getHandle() to prevent misuse and undefined behavior. When isMatched() returns false, getInfo() and getHandle() will throw std::runtime_error.
Note
This class is managed via shared_ptr without support for copy or move semantics to prevent multiple objects from holding the same handle, which could lead to undefined behavior if the message is received multiple times.

Member Function Documentation

◆ getHandle()

ucp_tag_message_h ucxx::TagProbeInfo::getHandle ( ) const

Get the message handle.

Exceptions
std::runtime_errorif the handle is nullptr or has been consumed.
Returns
The UCP tag message handle.

◆ getInfo()

const TagRecvInfo& ucxx::TagProbeInfo::getInfo ( ) const

Get tag receive information.

Exceptions
std::runtime_errorif no message was matched.
Returns
The tag receive information.

◆ isMatched()

bool ucxx::TagProbeInfo::isMatched ( ) const

Check if a message was matched.

Returns
true if a message was matched, false otherwise.

◆ releaseHandle()

ucp_tag_message_h ucxx::TagProbeInfo::releaseHandle ( ) const

Release the message handle.

Same as getHandle() but also marks the handle as consumed, therefore no warning is logged when the object is destroyed and is the user's responsibility to consume the handle via a direct UCP operation.

Exceptions
std::runtime_errorif the handle is nullptr or has been consumed.
Returns
The UCP tag message handle.

Friends And Related Function Documentation

◆ createTagProbeInfo [1/2]

std::shared_ptr<TagProbeInfo> createTagProbeInfo ( )
friend

Constructor for shared_ptr<ucxx::TagProbeInfo>.

The constructor for a shared_ptr<ucxx::TagProbeInfo> object, initializing the object as unmatched (isMatched() returns false).

auto tagProbeInfo = ucxx::createTagProbeInfo();
std::shared_ptr< TagProbeInfo > createTagProbeInfo()
Returns
The shared_ptr<ucxx::TagProbeInfo> object

◆ createTagProbeInfo [2/2]

std::shared_ptr<TagProbeInfo> createTagProbeInfo ( const ucp_tag_recv_info_t &  info,
ucp_tag_message_h  handle 
)
friend

Constructor for shared_ptr<ucxx::TagProbeInfo>.

The constructor for a shared_ptr<ucxx::TagProbeInfo> object, initializing the object as matched (isMatched() returns true) with the provided info and handle.

auto tagProbeInfo = ucxx::createTagProbeInfo(info, handle);
Parameters
[in]infoThe UCP tag receive info structure.
[in]handleThe UCP tag message handle (can be nullptr if tagProbe() is called with remove=false).
Returns
The shared_ptr<ucxx::TagProbeInfo> object

The documentation for this class was generated from the following file: