Public Member Functions
org.ros.node.topic.Publisher< T > Interface Reference
Inheritance diagram for org.ros.node.topic.Publisher< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void addListener (PublisherListener< T > listener)
boolean getLatchMode ()
int getNumberOfSubscribers ()
boolean hasSubscribers ()
newMessage ()
void publish (T message)
void setLatchMode (boolean enabled)
void shutdown (long timeout, TimeUnit unit)
void shutdown ()

Detailed Description

Publishes messages of a given type on a given ROS topic.

Author:
ethan.rublee@gmail.com (Ethan Rublee)
damonkohler@google.com (Damon Kohler)
Parameters:
<T>the Publisher may only publish messages of this type

Definition at line 32 of file Publisher.java.


Member Function Documentation

void org.ros.node.topic.Publisher< T >.addListener ( PublisherListener< T >  listener)

Add a new lifecycle listener to the Publisher.

Parameters:
listenerthe PublisherListener to add
boolean org.ros.node.topic.Publisher< T >.getLatchMode ( )
See also:
Publisher options documentation
Returns:
 true 
if published messages will be latched,
 false 
otherwise
int org.ros.node.topic.Publisher< T >.getNumberOfSubscribers ( )

Get the number of 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.

Returns:
the number of Subscribers currently connected to the Publisher
boolean org.ros.node.topic.Publisher< T >.hasSubscribers ( )
Returns:
 true 
if ,
 false 
otherwise
T org.ros.node.topic.Publisher< T >.newMessage ( )

Create a new message.

Returns:
a new message
void org.ros.node.topic.Publisher< T >.publish ( message)

Publishes a message. This message will be available on the topic that this Publisher has been associated with.

Parameters:
messagethe message to publish
void org.ros.node.topic.Publisher< T >.setLatchMode ( boolean  enabled)
See also:
Publisher options documentation
Parameters:
enabled
 true 
if published messages should be latched,
 false 
otherwise
void org.ros.node.topic.Publisher< T >.shutdown ( long  timeout,
TimeUnit  unit 
)

Shuts down and unregisters the 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 org.ros.node.topic.Publisher< T >.shutdown ( )

Shuts down and unregisters the Publisher using the default timeout for PublisherListener#onShutdown(Publisher) callbacks.

PublisherListener#onShutdown(Publisher) callbacks are executed in separate threads.

See also:
Publisher::shutdown(long, TimeUnit)

The documentation for this interface was generated from the following file:


rosjava_core
Author(s):
autogenerated on Wed Aug 26 2015 16:06:51