org.ros.internal.node.topic
Class SubscriberFactory

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

public class SubscriberFactory
extends java.lang.Object

A factory for Subscriber instances.


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

Constructor Detail

SubscriberFactory

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

newOrExisting

public <T> Subscriber<T> newOrExisting(TopicDeclaration topicDeclaration,
                                       MessageDeserializer<T> messageDeserializer)
Gets or creates a Subscriber instance. Subscribers are cached and reused per topic. When a new Subscriber is generated, it is registered with the master.

Type Parameters:
T - the message type associated with the new Subscriber
Parameters:
topicDeclaration - TopicDeclaration that is subscribed to
messageDeserializer - the MessageDeserializer to use for incoming messages
Returns:
a new or cached Subscriber instance