Simplified service types: the nested types Request/Response are templates now, but the containing type is not, so using 'typename' to refer to Request or Response is no longer necessary.

This commit is contained in:
Pavel Kirienko
2014-03-12 21:20:05 +04:00
parent 7bc7269e37
commit beaba20749
4 changed files with 38 additions and 23 deletions
@@ -1,6 +1,7 @@
bool TRUE = true
bool NOT_TRUE = false * true
uint64 BIG = (1 << 64) - 1
float64 FLOAT_CONSTANT = 3.14
uint8[<128] string_request
---
float64 FLOAT_CONSTANT = 1.79769313486231570815e+308
+4 -4
View File
@@ -16,8 +16,8 @@ struct ServerImpl
ServerImpl(const char* string_response) : string_response(string_response) { }
void handleRequest(const uavcan::ReceivedDataStructure<typename root_ns_a::StringService::Request>& request,
typename root_ns_a::StringService::Response& response)
void handleRequest(const uavcan::ReceivedDataStructure<root_ns_a::StringService::Request>& request,
root_ns_a::StringService::Response& response)
{
std::cout << request << std::endl;
response.string_response = request.string_request;
@@ -27,8 +27,8 @@ struct ServerImpl
}
typedef uavcan::MethodBinder<ServerImpl*,
void (ServerImpl::*)(const uavcan::ReceivedDataStructure<typename root_ns_a::StringService::Request>&,
typename root_ns_a::StringService::Response&)> Binder;
void (ServerImpl::*)(const uavcan::ReceivedDataStructure<root_ns_a::StringService::Request>&,
root_ns_a::StringService::Response&)> Binder;
Binder bind() { return Binder(this, &ServerImpl::handleRequest); }
};