|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - the Publisher may only publish messages of this typepublic interface Publisher<T>
Publishes messages of a given type on a given ROS topic.
| Method Summary | |
|---|---|
void |
addListener(PublisherListener<T> listener)
Add a new lifecycle listener to the Publisher. |
boolean |
getLatchMode()
|
int |
getNumberOfSubscribers()
Get the number of Subscribers currently connected to the
Publisher. |
int |
getQueueLimit()
|
boolean |
hasSubscribers()
|
T |
newMessage()
Create a new message. |
void |
publish(T message)
Publishes a message. |
void |
removeListener(PublisherListener<T> listener)
Remove a lifecycle listener from the Publisher. |
void |
setLatchMode(boolean enabled)
|
void |
setQueueLimit(int limit)
|
void |
shutdown()
Shuts down and unregisters the Publisher using the default timeout
for PublisherListener.onShutdown(Publisher) callbacks. |
void |
shutdown(long timeout,
java.util.concurrent.TimeUnit unit)
Shuts down and unregisters the Publisher. |
| Methods inherited from interface org.ros.internal.node.topic.TopicParticipant |
|---|
getTopicMessageType, getTopicName |
| Method Detail |
|---|
void setLatchMode(boolean enabled)
enabled - true if published messages should be latched,
false otherwiseboolean getLatchMode()
true if published messages will be latched, false
otherwiseT newMessage()
void publish(T message)
Publisher has been associated with.
message - the message to publishboolean hasSubscribers()
true if getNumberOfSubscribers() > 0, false
otherwiseint getNumberOfSubscribers()
Subscribers currently connected to the
Publisher.
This counts the number of Subscriber registered. If a
Subscriber does not shutdown properly it will not be unregistered
and thus will contribute to this count.
Subscribers currently connected to the
Publisher
void shutdown(long timeout,
java.util.concurrent.TimeUnit unit)
Publisher. Shutdown is delayed by at
most the specified timeout to allow
PublisherListener.onShutdown(Publisher) callbacks to complete.
PublisherListener.onShutdown(Publisher) callbacks are executed in
separate threads.
void shutdown()
Publisher using the default timeout
for PublisherListener.onShutdown(Publisher) callbacks.
PublisherListener.onShutdown(Publisher) callbacks are executed in
separate threads.
shutdown(long, TimeUnit)void addListener(PublisherListener<T> listener)
Publisher.
listener - the PublisherListener to addvoid removeListener(PublisherListener<T> listener)
Publisher.
Nothing will happen if the given listener is not registered.
listener - the PublisherListener to removevoid setQueueLimit(int limit)
limit - the maximum number of messages to queue (i.e. buffer) for sendingint getQueueLimit()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||