Loading...
Searching...
No Matches
register_inflight_request.h
1
5#pragma once
6
7#include <memory>
8#include <tuple>
9#include <utility>
10
11#include <ucxx/endpoint.h>
12#include <ucxx/request.h>
13#include <ucxx/worker.h>
14
15namespace ucxx {
16
17class Component;
18
19namespace detail {
20
21inline void registerInflightRequest(std::shared_ptr<Component> component,
22 std::shared_ptr<Request> req)
23{
24 if (auto ep = std::dynamic_pointer_cast<Endpoint>(component))
25 std::ignore = ep->registerInflightRequest(std::move(req));
26 else if (auto wk = std::dynamic_pointer_cast<Worker>(component))
27 std::ignore = wk->registerInflightRequest(std::move(req));
28}
29
30} // namespace detail
31
32} // namespace ucxx
A UCXX component class to prevent early destruction of parent object.
Definition component.h:21
Definition address.h:16