public static class RosBridge.RosBridgeSubscriber extends Object
RosListenDelegate objects and informs them all
when a message has been received from Rosbridge.| Modifier and Type | Field and Description |
|---|---|
protected List<RosListenDelegate> |
delegates |
| Constructor and Description |
|---|
RosBridgeSubscriber() |
RosBridgeSubscriber(RosListenDelegate... delegates)
Initializes and adds all the input delegates to receive messages.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDelegate(RosListenDelegate delegate)
Adds a delegate to receive messages from Rosbridge.
|
int |
numDelegates()
Returns the number of delegates listening to this topic.
|
void |
receive(com.fasterxml.jackson.databind.JsonNode data,
String stringRep)
Receives a new published message to a subscribed topic and informs all listeners.
|
void |
removeDelegate(RosListenDelegate delegate)
Removes a delegate from receiving messages from Rosbridge
|
protected List<RosListenDelegate> delegates
public RosBridgeSubscriber()
public RosBridgeSubscriber(RosListenDelegate... delegates)
delegates - the delegates to receive messages.public void addDelegate(RosListenDelegate delegate)
delegate - a delegate to receive messages from Rosbridge.public void removeDelegate(RosListenDelegate delegate)
delegate - the delegate to stop receiving messages.public void receive(com.fasterxml.jackson.databind.JsonNode data,
String stringRep)
data - the JsonNode containing the JSON data received.stringRep - the string representation of the JSON object.public int numDelegates()
Copyright © 2016. All rights reserved.