Service#
agnocast::Service<ServiceT>#
Agnocast service server. The callback signature is void(const ipc_shared_ptr
Example:
using SrvT = example_interfaces::srv::AddTwoInts;
using RequestT = agnocast::Service<SrvT>::RequestT;
using ResponseT = agnocast::Service<SrvT>::ResponseT;
auto service = agnocast::create_service<SrvT>(
this, "add_two_ints",
[this](const agnocast::ipc_shared_ptr<RequestT> & req,
agnocast::ipc_shared_ptr<ResponseT> & res) {
res->sum = req->a + req->b;
});