libuav original

Dependents:   UAVCAN UAVCAN_Subscriber

Embed: (wiki syntax)

« Back to documentation index

ServiceResponseDataStructure< ResponseDataType_ > Class Template Reference

ServiceResponseDataStructure< ResponseDataType_ > Class Template Reference

This type can be used in place of the response type in a service server callback to get more advanced control of service request processing. More...

#include <service_server.hpp>

Public Member Functions

void setResponseEnabled (bool x)
 When disabled, the server will not transmit the response transfer.
bool isResponseEnabled () const
 Whether the response will be sent.

Detailed Description

template<typename ResponseDataType_>
class uavcan::ServiceResponseDataStructure< ResponseDataType_ >

This type can be used in place of the response type in a service server callback to get more advanced control of service request processing.

PLEASE NOTE that since this class inherits the response type, service server callbacks can accept either object of this class or the response type directly if the extra options are not needed.

For example, both of these callbacks can be used with the same service type 'Foo':

void first(const ReceivedDataStructure<Foo::Request>& request, ServiceResponseDataStructure<Foo::Response>& response);

void second(const Foo::Request& request, Foo::Response& response);

In the latter case, an implicit cast will happen before the callback is invoked.

Definition at line 40 of file service_server.hpp.


Member Function Documentation

bool isResponseEnabled (  ) const

Whether the response will be sent.

By default it will.

Definition at line 61 of file service_server.hpp.

void setResponseEnabled ( bool  x )

When disabled, the server will not transmit the response transfer.

By default it is enabled, i.e. response will be sent.

Definition at line 56 of file service_server.hpp.