Class SubscriberFactory

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

public class SubscriberFactory extends Object
A factory for Subscriber instances.
Author:
damonkohler@google.com (Damon Kohler)
  • Constructor Details

  • Method Details

    • newOrExisting

      public <T> Subscriber<T> newOrExisting(TopicDeclaration topicDeclaration, org.ros.message.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