org.ros.internal.node.topic
Class PublisherFactory

java.lang.Object
  extended by org.ros.internal.node.topic.PublisherFactory

public class PublisherFactory
extends java.lang.Object

A factory for Publisher instances.


Constructor Summary
PublisherFactory(NodeIdentifier nodeIdentifier, TopicParticipantManager topicParticipantManager, MessageFactory messageFactory, java.util.concurrent.ScheduledExecutorService executorService)
           
 
Method Summary
<T> Publisher<T>
newOrExisting(TopicDeclaration topicDeclaration, MessageSerializer<T> messageSerializer)
          Gets or creates a Publisher instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PublisherFactory

public PublisherFactory(NodeIdentifier nodeIdentifier,
                        TopicParticipantManager topicParticipantManager,
                        MessageFactory messageFactory,
                        java.util.concurrent.ScheduledExecutorService executorService)
Method Detail

newOrExisting

public <T> Publisher<T> newOrExisting(TopicDeclaration topicDeclaration,
                                      MessageSerializer<T> messageSerializer)
Gets or creates a Publisher instance. Publishers are cached and reused per topic. When a new Publisher is generated, it is registered with the master.

Type Parameters:
T - the message type associated with the Publisher
Parameters:
topicDeclaration - TopicDeclaration that is being published
messageSerializer - the MessageSerializer used for published messages
Returns:
a new or cached Publisher instance