Class TopicRegistrationInfo

java.lang.Object
org.ros.internal.node.server.master.TopicRegistrationInfo

public class TopicRegistrationInfo extends Object
All information known to the manager about a topic.
Author:
khughes@google.com (Keith M. Hughes)
  • Constructor Details

    • TopicRegistrationInfo

      public TopicRegistrationInfo(GraphName topicName)
  • Method Details

    • getTopicName

      public GraphName getTopicName()
      Returns:
      the topicName
    • getMessageType

      public String getMessageType()
      Get the currently known message type of the topic.
      Returns:
      The message type. Can be null if unknown.
    • hasPublishers

      public boolean hasPublishers()
      Does the topic have any publishers?
      Returns:
      true if the topic has any publishers.
    • hasSubscribers

      public boolean hasSubscribers()
      Does the topic have any subscribers?
      Returns:
      true if the topic has any publishers or subscribers.
    • hasRegistrations

      public boolean hasRegistrations()
      Does the topic have any registrations?
      Returns:
      true if the topic has any publishers or subscribers.
    • getPublishers

      public Set<NodeRegistrationInfo> getPublishers()
      Get a list of all known publishers for the topic.
      Returns:
      an immutable list of publishers
    • addPublisher

      public void addPublisher(NodeRegistrationInfo publisher, String messageType)
      Add a new publisher to the topic.
      Parameters:
      publisher - the publisher to add
      messageType - the type of the message
    • removePublisher

      public boolean removePublisher(NodeRegistrationInfo publisher)
      Remove a publisher to the topic.
      Parameters:
      publisher - the publisher to add
      Returns:
      true if the publisher was registered in the first place
    • getSubscribers

      public Set<NodeRegistrationInfo> getSubscribers()
      Get a list of all known subscribers for the topic.
      Returns:
      an immutable list of publishers
    • addSubscriber

      public void addSubscriber(NodeRegistrationInfo subscriber, String messageType)
      Add a new subscriber to the topic.
      Parameters:
      subscriber - the subscriber to add
      messageType - the type of the message
    • removeSubscriber

      public boolean removeSubscriber(NodeRegistrationInfo subscriber)
      Remove a subscriber to the topic.
      Parameters:
      subscriber - the subscriber to add
      Returns:
      true if the subscriber was registered in the first place
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object