Public Types | Public Member Functions | Private Attributes | List of all members
uavcan::ServiceResponseDataStructure< ResponseDataType_ > Class Template Reference

#include <service_server.hpp>

Inheritance diagram for uavcan::ServiceResponseDataStructure< ResponseDataType_ >:
Inheritance graph
[legend]

Public Types

typedef ResponseDataType_ ResponseDataType
 

Public Member Functions

bool isResponseEnabled () const
 
 ServiceResponseDataStructure ()
 
void setResponseEnabled (bool x)
 

Private Attributes

bool _enabled_
 

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 Typedef Documentation

◆ ResponseDataType

template<typename ResponseDataType_ >
typedef ResponseDataType_ uavcan::ServiceResponseDataStructure< ResponseDataType_ >::ResponseDataType

Definition at line 46 of file service_server.hpp.

Constructor & Destructor Documentation

◆ ServiceResponseDataStructure()

template<typename ResponseDataType_ >
uavcan::ServiceResponseDataStructure< ResponseDataType_ >::ServiceResponseDataStructure ( )
inline

Definition at line 48 of file service_server.hpp.

Member Function Documentation

◆ isResponseEnabled()

template<typename ResponseDataType_ >
bool uavcan::ServiceResponseDataStructure< ResponseDataType_ >::isResponseEnabled ( ) const
inline

Whether the response will be sent. By default it will.

Definition at line 61 of file service_server.hpp.

◆ setResponseEnabled()

template<typename ResponseDataType_ >
void uavcan::ServiceResponseDataStructure< ResponseDataType_ >::setResponseEnabled ( bool  x)
inline

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.

Member Data Documentation

◆ _enabled_

template<typename ResponseDataType_ >
bool uavcan::ServiceResponseDataStructure< ResponseDataType_ >::_enabled_
private

Definition at line 43 of file service_server.hpp.


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


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:05