Public Types | Public Member Functions | Private Attributes | List of all members
foxglove_bridge::GenericClient Class Reference

#include <generic_client.hpp>

Inheritance diagram for foxglove_bridge::GenericClient:
Inheritance graph
[legend]

Public Types

using CallbackType = std::function< void(SharedFuture)>
 
using CallbackWithRequestType = std::function< void(SharedFutureWithRequest)>
 
using Promise = std::promise< SharedResponse >
 
using PromiseWithRequest = std::promise< std::pair< SharedRequest, SharedResponse > >
 
using SharedFuture = std::shared_future< SharedResponse >
 
using SharedFutureWithRequest = std::shared_future< std::pair< SharedRequest, SharedResponse > >
 
using SharedPromise = std::shared_ptr< Promise >
 
using SharedPromiseWithRequest = std::shared_ptr< PromiseWithRequest >
 
using SharedRequest = std::shared_ptr< rclcpp::SerializedMessage >
 
using SharedResponse = std::shared_ptr< rclcpp::SerializedMessage >
 

Public Member Functions

SharedFuture async_send_request (SharedRequest request)
 
SharedFuture async_send_request (SharedRequest request, CallbackType &&cb)
 
std::shared_ptr< rmw_request_id_t > create_request_header () override
 
std::shared_ptr< void > create_response () override
 
 GenericClient (rclcpp::node_interfaces::NodeBaseInterface *node_base, rclcpp::node_interfaces::NodeGraphInterface::SharedPtr node_graph, std::string service_name, std::string service_type, rcl_client_options_t &client_options)
 
void handle_response (std::shared_ptr< rmw_request_id_t > request_header, std::shared_ptr< void > response) override
 
virtual ~GenericClient ()
 

Private Attributes

const rosidl_message_type_support_t * _requestTypeSupportHdl
 
const rosidl_message_type_support_t * _responseTypeSupportHdl
 
const rosidl_service_type_support_t * _serviceTypeSupportHdl
 
const rosidl_service_type_support_t * _typeIntrospectionHdl
 
std::shared_ptr< rcpputils::SharedLibrary > _typeIntrospectionLib
 
std::shared_ptr< rcpputils::SharedLibrary > _typeSupportLib
 
std::map< int64_t, std::tuple< SharedPromise, CallbackType, SharedFuture > > pending_requests_
 
std::mutex pending_requests_mutex_
 

Detailed Description

Definition at line 11 of file generic_client.hpp.

Member Typedef Documentation

◆ CallbackType

Definition at line 21 of file generic_client.hpp.

◆ CallbackWithRequestType

Definition at line 22 of file generic_client.hpp.

◆ Promise

Definition at line 15 of file generic_client.hpp.

◆ PromiseWithRequest

Definition at line 16 of file generic_client.hpp.

◆ SharedFuture

Definition at line 19 of file generic_client.hpp.

◆ SharedFutureWithRequest

Definition at line 20 of file generic_client.hpp.

◆ SharedPromise

Definition at line 17 of file generic_client.hpp.

◆ SharedPromiseWithRequest

Definition at line 18 of file generic_client.hpp.

◆ SharedRequest

using foxglove_bridge::GenericClient::SharedRequest = std::shared_ptr<rclcpp::SerializedMessage>

Definition at line 13 of file generic_client.hpp.

◆ SharedResponse

using foxglove_bridge::GenericClient::SharedResponse = std::shared_ptr<rclcpp::SerializedMessage>

Definition at line 14 of file generic_client.hpp.

Constructor & Destructor Documentation

◆ GenericClient()

foxglove_bridge::GenericClient::GenericClient ( rclcpp::node_interfaces::NodeBaseInterface *  node_base,
rclcpp::node_interfaces::NodeGraphInterface::SharedPtr  node_graph,
std::string  service_name,
std::string  service_type,
rcl_client_options_t &  client_options 
)

Definition at line 94 of file generic_client.cpp.

◆ ~GenericClient()

virtual foxglove_bridge::GenericClient::~GenericClient ( )
inlinevirtual

Definition at line 30 of file generic_client.hpp.

Member Function Documentation

◆ async_send_request() [1/2]

GenericClient::SharedFuture foxglove_bridge::GenericClient::async_send_request ( SharedRequest  request)

Definition at line 184 of file generic_client.cpp.

◆ async_send_request() [2/2]

GenericClient::SharedFuture foxglove_bridge::GenericClient::async_send_request ( SharedRequest  request,
CallbackType &&  cb 
)

Definition at line 188 of file generic_client.cpp.

◆ create_request_header()

std::shared_ptr< rmw_request_id_t > foxglove_bridge::GenericClient::create_request_header ( )
override

Definition at line 150 of file generic_client.cpp.

◆ create_response()

std::shared_ptr< void > foxglove_bridge::GenericClient::create_response ( )
override

Definition at line 145 of file generic_client.cpp.

◆ handle_response()

void foxglove_bridge::GenericClient::handle_response ( std::shared_ptr< rmw_request_id_t >  request_header,
std::shared_ptr< void >  response 
)
override

Definition at line 154 of file generic_client.cpp.

Member Data Documentation

◆ _requestTypeSupportHdl

const rosidl_message_type_support_t* foxglove_bridge::GenericClient::_requestTypeSupportHdl
private

Definition at line 47 of file generic_client.hpp.

◆ _responseTypeSupportHdl

const rosidl_message_type_support_t* foxglove_bridge::GenericClient::_responseTypeSupportHdl
private

Definition at line 48 of file generic_client.hpp.

◆ _serviceTypeSupportHdl

const rosidl_service_type_support_t* foxglove_bridge::GenericClient::_serviceTypeSupportHdl
private

Definition at line 46 of file generic_client.hpp.

◆ _typeIntrospectionHdl

const rosidl_service_type_support_t* foxglove_bridge::GenericClient::_typeIntrospectionHdl
private

Definition at line 49 of file generic_client.hpp.

◆ _typeIntrospectionLib

std::shared_ptr<rcpputils::SharedLibrary> foxglove_bridge::GenericClient::_typeIntrospectionLib
private

Definition at line 45 of file generic_client.hpp.

◆ _typeSupportLib

std::shared_ptr<rcpputils::SharedLibrary> foxglove_bridge::GenericClient::_typeSupportLib
private

Definition at line 44 of file generic_client.hpp.

◆ pending_requests_

std::map<int64_t, std::tuple<SharedPromise, CallbackType, SharedFuture> > foxglove_bridge::GenericClient::pending_requests_
private

Definition at line 42 of file generic_client.hpp.

◆ pending_requests_mutex_

std::mutex foxglove_bridge::GenericClient::pending_requests_mutex_
private

Definition at line 43 of file generic_client.hpp.


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


foxglove_bridge
Author(s): Foxglove
autogenerated on Mon Jul 3 2023 02:12:22