Class ForwardManagement
Defined in File forward_management.hpp
Class Documentation
-
class ForwardManagement
Manage all service client proxies. Maintain the correspondence between the original Request ID and the proxy request sequence.
Public Functions
-
explicit ForwardManagement(LoadBalancingStrategy strategy = LoadBalancingStrategy::ROUND_ROBIN)
-
inline ~ForwardManagement()
Register a service client proxy.
- Parameters:
A – shared generic client to be registered
- Returns:
False if Client proxy already existed, otherwise True.
Unregister a service client proxy.
- Parameters:
client – A shared generic client to be unregistered
- Returns:
False if Client proxy is unregistered, otherwise True.
-
std::optional<SharedClientProxy> request_client_proxy()
Choose a service client proxy according to load balancing strategy.
- Returns:
A shared pointer to a service client proxy.
Add a record that describes the correspondence between the client proxy, proxy request sequence, and the original request ID.
- Parameters:
client_proxy – A shared pointer to a service client proxy
proxy_request_sequence – The sequence number of request managed by ServiceClientProxyManager
shared_request_id – A shared pointer to rmw_request_id_t
- Returns:
False if the client proxy with proxy request sequence already existed, otherwise True.
Get the original request ID according to the client proxy with proxy request sequence.
- Parameters:
client_proxy – A shared pointer to a service client proxy
proxy_request_sequence – The sequence number of request managed by ServiceClientProxyManager
- Returns:
A shared pointer to rmw_request_id_t.
Public Static Attributes
-
static std::unordered_map<std::string, LoadBalancingStrategy> supported_load_balancing_strategy
-
explicit ForwardManagement(LoadBalancingStrategy strategy = LoadBalancingStrategy::ROUND_ROBIN)