Type to represent an event entry from an EventQueue.
More...
#include <Event.hpp>
|
| Connected const & | connected () const |
| | Get a connected representation of the event. Throws if the event is not a connected event. Users should previously check if the event is a connected event, see isConnected().
|
| ConnectionRequested const & | connReq () const |
| | Get a connection request representation of the event. Throws if the event is not a connection request. Users should previously check if the event is a connection request, see isConnReq().
|
| Error const & | error () const |
| | Get an error representation of the event. Throws if the event is an error. Users should previously check if the event is an error, see isError().
|
| fid_t | fid () noexcept |
| | fabric descriptor associated with the event
|
| bool | isConnected () const noexcept |
| | Returns true if this event is a FI_CONNECTED.
|
| bool | isConnReq () const noexcept |
| | returns true if this event is a FI_CONNREQ
|
| bool | isError () const noexcept |
| | Returns true if this event is an error entry.
|
| bool | isShutdown () const noexcept |
| | returns true if this event is a FI_SHUTDOWN
|
| Shutdown const & | shutdown () const |
| | Get a shutdown representation of the event. Throws if the event is not a shutdown event. Users should previously check if the event is a shutdown event, see isShutdown().
|
Type to represent an event entry from an EventQueue.
Definition at line 20 of file Event.hpp.
◆ Inner
◆ Event()
| mxl::lib::fabrics::ofi::Event::Event |
( |
Inner | ev | ) |
|
|
private |
◆ connected()
Get a connected representation of the event. Throws if the event is not a connected event. Users should previously check if the event is a connected event, see isConnected().
Definition at line 134 of file Event.cpp.
135 {
136 return std::get<Event::Connected>(
_event);
137 }
◆ connReq()
Get a connection request representation of the event. Throws if the event is not a connection request. Users should previously check if the event is a connection request, see isConnReq().
Definition at line 124 of file Event.cpp.
125 {
126 return std::get<Event::ConnectionRequested>(
_event);
127 }
◆ error()
| Event::Error const & mxl::lib::fabrics::ofi::Event::error |
( |
| ) |
const |
|
nodiscard |
Get an error representation of the event. Throws if the event is an error. Users should previously check if the event is an error, see isError().
Definition at line 154 of file Event.cpp.
155 {
156 return std::get<Event::Error>(
_event);
157 }
◆ fid()
| fid_t mxl::lib::fabrics::ofi::Event::fid |
( |
| ) |
|
|
nodiscardnoexcept |
fabric descriptor associated with the event
Definition at line 159 of file Event.cpp.
160 {
161 return std::visit(
162 overloaded{
165 [](
Shutdown& ev) {
return ev.fid(); },
166 [](
Error& err) {
return err.fid(); },
167 },
169 }
A type that wraps a "FI_CONNECTED" event type.
A type that wraps a "FI_CONNREQ" event type.
A type that wraps an error received from the event queue.
A type that wraps a "FI_SHUTDOWN" event type.
◆ fromError()
| Event mxl::lib::fabrics::ofi::Event::fromError |
( |
std::shared_ptr< EventQueue > | queue, |
|
|
::fi_eq_err_entry const * | raw ) |
|
static |
create an Event from a libfabric event error entry
Definition at line 104 of file Event.cpp.
105 {
106 auto errDataBuffer =
reinterpret_cast<std::uint8_t*
>(
raw->err_data);
107
108 return {
110 std::move(queue),
114 std::vector<uint8_t>(errDataBuffer, errDataBuffer +
raw->err_data_size),
115 },
116 };
117 }
::fi_info * raw() noexcept
Returns the raw fi_info object managed by this FabricInfo instance.
◆ fromRawCMEntry()
| Event mxl::lib::fabrics::ofi::Event::fromRawCMEntry |
( |
::fi_eq_cm_entry const & | raw, |
|
|
std::uint32_t | eventType ) |
|
static |
create an Event from a libfabric Connection Management event
Definition at line 91 of file Event.cpp.
92 {
93
94 switch (eventType)
95 {
97 case FI_CONNECTED:
return {
Connected{entry.fid}};
98 case FI_SHUTDOWN:
return {
Shutdown{entry.fid}};
100 }
101
102 }
static Exception internal(fmt::format_string< T... > fmt, T &&... args)
Make an MXL_ERR_INTERNAL exception.
◆ fromRawEntry()
| Event mxl::lib::fabrics::ofi::Event::fromRawEntry |
( |
::fi_eq_entry const & | raw, |
|
|
std::uint32_t | eventType ) |
|
static |
◆ isConnected()
| bool mxl::lib::fabrics::ofi::Event::isConnected |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns true if this event is a FI_CONNECTED.
Definition at line 129 of file Event.cpp.
130 {
131 return std::holds_alternative<Connected>(
_event);
132 }
◆ isConnReq()
| bool mxl::lib::fabrics::ofi::Event::isConnReq |
( |
| ) |
const |
|
nodiscardnoexcept |
returns true if this event is a FI_CONNREQ
Definition at line 119 of file Event.cpp.
120 {
121 return std::holds_alternative<ConnectionRequested>(
_event);
122 }
◆ isError()
| bool mxl::lib::fabrics::ofi::Event::isError |
( |
| ) |
const |
|
nodiscardnoexcept |
Returns true if this event is an error entry.
Definition at line 149 of file Event.cpp.
150 {
151 return std::holds_alternative<Error>(
_event);
152 }
◆ isShutdown()
| bool mxl::lib::fabrics::ofi::Event::isShutdown |
( |
| ) |
const |
|
nodiscardnoexcept |
returns true if this event is a FI_SHUTDOWN
Definition at line 139 of file Event.cpp.
140 {
141 return std::holds_alternative<Shutdown>(
_event);
142 }
◆ shutdown()
Get a shutdown representation of the event. Throws if the event is not a shutdown event. Users should previously check if the event is a shutdown event, see isShutdown().
Definition at line 144 of file Event.cpp.
145 {
146 return std::get<Event::Shutdown>(
_event);
147 }
◆ _event
| Inner mxl::lib::fabrics::ofi::Event::_event |
|
private |
The documentation for this class was generated from the following files: