All Classes Namespaces Functions Variables Typedefs Enumerations Friends
Public Member Functions | Friends | List of all members
ucxx::Address Class Reference

Component encapsulating the address of a UCP worker. More...

#include <address.h>

Inheritance diagram for ucxx::Address:
ucxx::Component

Public Member Functions

 Address (const Address &)=delete
 
Addressoperator= (Address const &)=delete
 
 Address (Address &&o)=delete
 
Addressoperator= (Address &&o)=delete
 
ucp_address_t * getHandle () const
 Get the underlying ucp_address_t* handle. More...
 
size_t getLength () const
 Get the length of the ucp_address_t* handle. More...
 
std::string getString () const
 Get the address as a string. More...
 
- Public Member Functions inherited from ucxx::Component
void setParent (std::shared_ptr< Component > parent)
 Set the internal parent reference. More...
 
std::shared_ptr< ComponentgetParent () const
 Get the internal parent reference. More...
 

Friends

std::shared_ptr< AddresscreateAddressFromWorker (std::shared_ptr< Worker > worker)
 Constructor for shared_ptr<ucxx::Address> from worker. More...
 
std::shared_ptr< AddresscreateAddressFromString (std::string addressString)
 Constructor for shared_ptr<ucxx::Address> from string. More...
 

Additional Inherited Members

- Protected Attributes inherited from ucxx::Component
std::shared_ptr< Component_parent {nullptr}
 A reference-counted pointer to the parent.
 

Detailed Description

Component encapsulating the address of a UCP worker.

A UCP worker has a unique address that can is contained in a ucp_address_t* object, this class encapsulates that object and provides methods to simplify its handling.

Member Function Documentation

◆ getHandle()

ucp_address_t* ucxx::Address::getHandle ( ) const

Get the underlying ucp_address_t* handle.

Lifetime of the ucp_address_t* handle is managed by the ucxx::Address object and its ownership is non-transferrable. Once the ucxx::Address is destroyed the handle is not valid anymore, it is the user's responsibility to ensure the owner's lifetime while using the handle.

// address is `std::shared_ptr<ucxx::Address>`
ucp_address_t* addressHandle = address->getHandle();
Returns
The underlying ucp_address_t handle.

◆ getLength()

size_t ucxx::Address::getLength ( ) const

Get the length of the ucp_address_t* handle.

Get the length of the ucp_address_t* handle, required to access the complete address and prevent reading out-of-bound.

Returns
The length of the ucp_address_t* handle in bytes.

◆ getString()

std::string ucxx::Address::getString ( ) const

Get the address as a string.

Convenience method to copy the underlying address to a std::string and return it as a single object.

Returns
The underlying ucp_address_t handle.

Friends And Related Function Documentation

◆ createAddressFromString

std::shared_ptr<Address> createAddressFromString ( std::string  addressString)
friend

Constructor for shared_ptr<ucxx::Address> from string.

The constructor for a shared_ptr<ucxx::Address> object from the address extracted as string from a remote std::shared_ptr<ucxx::Worker>.

Parameters
[in]addressStringthe string from which to create the address.
Returns
The shared_ptr<ucxx::Address> object.

◆ createAddressFromWorker

std::shared_ptr<Address> createAddressFromWorker ( std::shared_ptr< Worker worker)
friend

Constructor for shared_ptr<ucxx::Address> from worker.

The constructor for a shared_ptr<ucxx::Address> object from a std::shared_ptr<ucxx::Worker> to obtain its address.

Parameters
[in]workerparent worker from which to get the address.
Returns
The shared_ptr<ucxx::Address> object.

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