lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
Pds::Fabrics::EndpointBase Class Reference

Common base of active and passive endpoints: holds the Fabric, the event queue and the transmit and receive completion queues, creating any that are not supplied. More...

#include <Endpoint.hh>

Inherits Pds::Fabrics::ErrorHandler.

Inherited by Pds::Fabrics::Endpoint, and Pds::Fabrics::PassiveEndpoint.

Public Member Functions

State state () const
 Return the current endpoint State.
 
Fabric * fabric () const
 Return the Fabric used by this endpoint.
 
EventQueue * eq () const
 Return the event queue.
 
CompletionQueue * txcq () const
 Return the transmit completion queue.
 
CompletionQueue * rxcq () const
 Return the receive completion queue.
 
virtual void shutdown ()
 Delete the event and completion queues that this object created and set the state to EP_CLOSED.
 
bool event (uint32_t *event, void *entry, bool *cm_entry)
 Read one event from the event queue without blocking (EventQueue::event()); returns false, copying the queue's error, if no event was read.
 
bool event_wait (uint32_t *event, void *entry, bool *cm_entry, int timeout=-1)
 Wait for one event on the event queue with the given timeout (EventQueue::event_wait()); returns false, copying the queue's error, if no event was read.
 
bool event_error (struct fi_eq_err_entry *entry)
 Read one error entry from the event queue into entry; returns false, copying the queue's error, if none could be read.
 
- Public Member Functions inherited from Pds::Fabrics::ErrorHandler
 ErrorHandler ()
 Allocate the message buffer and start with no error (FI_SUCCESS and a message built from the text None).
 
virtual ~ErrorHandler ()
 Free the message buffer.
 
int error_num () const
 Return the last recorded error number (FI_SUCCESS if none).
 
const char * error () const
 Return the last recorded error message.
 
void clear_error ()
 Reset the error number to FI_SUCCESS and the message to the no-error text.
 

Protected Member Functions

 EndpointBase (const char *addr, const char *port, uint64_t flags=0, Info *hints=0)
 
 EndpointBase (Fabric *fabric, EventQueue *eq=0, CompletionQueue *txcq=0, CompletionQueue *rxcq=0)
 
virtual ~EndpointBase ()
 
bool handle_event (ssize_t event_ret, bool *cm_entry, const char *cmd)
 
bool initialize ()
 
- Protected Member Functions inherited from Pds::Fabrics::ErrorHandler
void set_custom_error (const char *fmt,...)
 
void set_error (const char *error_desc)
 

Protected Attributes

State _state
 
const bool _fab_owner
 
bool _eq_owner
 
bool _txcq_owner
 
bool _rxcq_owner
 
Fabric * _fabric
 
EventQueue * _eq
 
CompletionQueue * _txcq
 
CompletionQueue * _rxcq
 
- Protected Attributes inherited from Pds::Fabrics::ErrorHandler
int _errno
 
char * _error
 

Detailed Description

Common base of active and passive endpoints: holds the Fabric, the event queue and the transmit and receive completion queues, creating any that are not supplied.

Constructor & Destructor Documentation

◆ EndpointBase() [1/2]

Pds::Fabrics::EndpointBase::EndpointBase ( const char *  addr,
const char *  port,
uint64_t  flags = 0,
Info *  hints = 0 
)
protected

◆ EndpointBase() [2/2]

Pds::Fabrics::EndpointBase::EndpointBase ( Fabric *  fabric,
EventQueue *  eq = 0,
CompletionQueue *  txcq = 0,
CompletionQueue *  rxcq = 0 
)
protected

◆ ~EndpointBase()

virtual Pds::Fabrics::EndpointBase::~EndpointBase ( )
protectedvirtual

Member Function Documentation

◆ eq()

EventQueue * Pds::Fabrics::EndpointBase::eq ( ) const

Return the event queue.

◆ event()

bool Pds::Fabrics::EndpointBase::event ( uint32_t *  event,
void *  entry,
bool *  cm_entry 
)

Read one event from the event queue without blocking (EventQueue::event()); returns false, copying the queue's error, if no event was read.

◆ event_error()

bool Pds::Fabrics::EndpointBase::event_error ( struct fi_eq_err_entry *  entry)

Read one error entry from the event queue into entry; returns false, copying the queue's error, if none could be read.

◆ event_wait()

bool Pds::Fabrics::EndpointBase::event_wait ( uint32_t *  event,
void *  entry,
bool *  cm_entry,
int  timeout = -1 
)

Wait for one event on the event queue with the given timeout (EventQueue::event_wait()); returns false, copying the queue's error, if no event was read.

◆ fabric()

Fabric * Pds::Fabrics::EndpointBase::fabric ( ) const

Return the Fabric used by this endpoint.

◆ handle_event()

bool Pds::Fabrics::EndpointBase::handle_event ( ssize_t  event_ret,
bool *  cm_entry,
const char *  cmd 
)
protected

◆ initialize()

bool Pds::Fabrics::EndpointBase::initialize ( )
protected

◆ rxcq()

CompletionQueue * Pds::Fabrics::EndpointBase::rxcq ( ) const

Return the receive completion queue.

When none was supplied and the transmit queue was created internally, this is the same object as txcq().

◆ shutdown()

virtual void Pds::Fabrics::EndpointBase::shutdown ( )
virtual

Delete the event and completion queues that this object created and set the state to EP_CLOSED.

Reimplemented in Pds::Fabrics::Endpoint, and Pds::Fabrics::PassiveEndpoint.

◆ state()

State Pds::Fabrics::EndpointBase::state ( ) const

Return the current endpoint State.

◆ txcq()

CompletionQueue * Pds::Fabrics::EndpointBase::txcq ( ) const

Return the transmit completion queue.

Member Data Documentation

◆ _eq

EventQueue* Pds::Fabrics::EndpointBase::_eq
protected

◆ _eq_owner

bool Pds::Fabrics::EndpointBase::_eq_owner
protected

◆ _fab_owner

const bool Pds::Fabrics::EndpointBase::_fab_owner
protected

◆ _fabric

Fabric* Pds::Fabrics::EndpointBase::_fabric
protected

◆ _rxcq

CompletionQueue* Pds::Fabrics::EndpointBase::_rxcq
protected

◆ _rxcq_owner

bool Pds::Fabrics::EndpointBase::_rxcq_owner
protected

◆ _state

State Pds::Fabrics::EndpointBase::_state
protected

◆ _txcq

CompletionQueue* Pds::Fabrics::EndpointBase::_txcq
protected

◆ _txcq_owner

bool Pds::Fabrics::EndpointBase::_txcq_owner
protected

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