Class: ROS::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/ros/topic.rb

Overview

Base class of Publisher and Subscriber

Direct Known Subclasses

Publisher, Subscriber

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(caller_id, topic_name, topic_type) ⇒ Topic

initialize member variables



19
20
21
22
23
24
25
# File 'lib/ros/topic.rb', line 19

def initialize(caller_id, topic_name, topic_type)
  @caller_id = caller_id
  @topic_name = topic_name
  @topic_type = topic_type
  @connections = []
  @connection_id_number = 0
end

Instance Attribute Details

#caller_idString (readonly)



28
29
30
# File 'lib/ros/topic.rb', line 28

def caller_id
  @caller_id
end

#topic_nameString (readonly)



31
32
33
# File 'lib/ros/topic.rb', line 31

def topic_name
  @topic_name
end

#topic_typeClass (readonly)



34
35
36
# File 'lib/ros/topic.rb', line 34

def topic_type
  @topic_type
end

Instance Method Details

#closeObject

shutdown all connections



37
38
39
# File 'lib/ros/topic.rb', line 37

def close #:nodoc:
  @connections.each {|connection| connection.shutdown}
end

#set_manager(manager) ⇒ Object

set manager for shutdown



43
44
45
# File 'lib/ros/topic.rb', line 43

def set_manager(manager) #:nodoc:
  @manager = manager
end