Package org.ros.node.service
Interface ServiceClient<T,S>
- Type Parameters:
T- theServiceServerresponds to requests of this typeS- theServiceServerreturns responses of this type
- All Known Implementing Classes:
DefaultServiceClient
public interface ServiceClient<T,S>
Provides a connection to a ROS service.
- Author:
- damonkohler@google.com (Damon Kohler)
-
Method Summary
Modifier and TypeMethodDescriptionvoidcall(T request, ServiceResponseListener<S> listener) Calls a method on theServiceServer.voidConnects to aServiceServer.getName()booleanvoidshutdown()Stops the client (e.g.
-
Method Details
-
connect
Connects to aServiceServer.- Parameters:
uri- theURIof theServiceServerto connect to
-
isConnected
boolean isConnected()- Returns:
trueif theServiceClientis connected
-
call
Calls a method on theServiceServer.- Parameters:
request- the request messagelistener- theServiceResponseListenerthat will handle the response to this request
-
getName
GraphName getName()- Returns:
- the name of the service this
ServiceClientis connected to
-
shutdown
void shutdown()Stops the client (e.g. disconnect a persistent service connection). -
newMessage
T newMessage()- Returns:
- a new request message
-