|
mrs_lib
Various reusable classes, functions and utilities for use in MRS projects
|
rclcpp::Service wrapper with coroutines support. More...
#include <service_server.hpp>
Public Types | |
| using | ServiceCallback = std::function<void(std::shared_ptr<const Request> req, std::shared_ptr<Response>)> |
| Type of the accepted callback. | |
| using | ServiceCoroCallback = CoroCallback<void(std::shared_ptr<const Request> req, std::shared_ptr<Response>)> |
| Type of the accepted coroutine callback. | |
Public Member Functions | |
| ServiceServer (const ServiceServerOptions &options, std::string_view service_name, ServiceCallback callback) | |
| Construct the service server with the specified callback. | |
| ServiceServer (const ServiceServerOptions &options, std::string_view service_name, ServiceCoroCallback callback) | |
| Construct the service server with the specified coroutine callback. | |
| std::string | get_service_name () const |
| Returns the resolved (full) name of the service handled by this service server. | |
| std::string | get_unresolved_service_name () const |
| Returns the unresolved name of the service handled by this service server. | |
rclcpp::Service wrapper with coroutines support.
| ServiceType | Type of the service this server will provide. |
| mrs_lib::ServiceServer< ServiceType >::ServiceServer | ( | const ServiceServerOptions & | options, |
| std::string_view | service_name, | ||
| ServiceCallback | callback ) |
Construct the service server with the specified callback.
options Options to configure the service server.
| service_name | Name of the service to provide. |
| callback | Callback to call when a request is received. |
| mrs_lib::ServiceServer< ServiceType >::ServiceServer | ( | const ServiceServerOptions & | options, |
| std::string_view | service_name, | ||
| ServiceCoroCallback | callback ) |
Construct the service server with the specified coroutine callback.
options Options to configure the service server.
| service_name | Name of the service to provide. |
| callback | Coroutine callback to call when a request is received. |
|
nodiscard |
Returns the resolved (full) name of the service handled by this service server.
|
nodiscard |
Returns the unresolved name of the service handled by this service server.