Public Member Functions | |
void | addMessageListener (MessageListener< T > messageListener, int limit) |
void | addMessageListener (MessageListener< T > messageListener) |
void | addSubscriberListener (SubscriberListener< T > listener) |
boolean | getLatchMode () |
void | shutdown (long timeout, TimeUnit unit) |
void | shutdown () |
Static Public Attributes | |
static final String | TOPIC_MESSAGE_TYPE_WILDCARD = "*" |
Subscribes to messages of a given type on a given ROS topic.
<T> | the Subscriber may only subscribe to messages of this type |
Definition at line 33 of file Subscriber.java.
void org.ros.node.topic.Subscriber< T >.addMessageListener | ( | MessageListener< T > | messageListener, |
int | limit | ||
) |
Adds a MessageListener to be called when new messages are received.
The MessageListener will be executed serially in its own thread. If the MessageListener processes new messages slower than they arrive, new messages will be queued up to the specified limit. Older messages are removed from the buffer when the buffer limit is exceeded.
messageListener | this MessageListener will be called when new messages are received |
limit | the maximum number of messages to buffer |
void org.ros.node.topic.Subscriber< T >.addMessageListener | ( | MessageListener< T > | messageListener | ) |
Adds a MessageListener with a limit of 1.
void org.ros.node.topic.Subscriber< T >.addSubscriberListener | ( | SubscriberListener< T > | listener | ) |
Add a new lifecycle listener to the subscriber.
listener | The listener to add. |
boolean org.ros.node.topic.Subscriber< T >.getLatchMode | ( | ) |
true
false
void org.ros.node.topic.Subscriber< T >.shutdown | ( | long | timeout, |
TimeUnit | unit | ||
) |
Shuts down and unregisters the Subscriber. using the default timeout Shutdown is delayed by at most the specified timeout to allow SubscriberListener#onShutdown(Subscriber) callbacks to complete.
SubscriberListener#onShutdown(Subscriber) callbacks are executed in separate threads.
void org.ros.node.topic.Subscriber< T >.shutdown | ( | ) |
Shuts down and unregisters the Subscriber using the default timeout for SubscriberListener#onShutdown(Subscriber) callbacks.
SubscriberListener#onShutdown(Subscriber) callbacks are executed in separate threads.
final String org.ros.node.topic.Subscriber< T >.TOPIC_MESSAGE_TYPE_WILDCARD = "*" [static] |
The message type given when a Subscriber chooses not to commit to a specific message type.
Definition at line 39 of file Subscriber.java.