Class: ROS::Topic
- Inherits:
-
Object
- Object
- ROS::Topic
- Defined in:
- lib/ros/topic.rb
Overview
Base class of Publisher and Subscriber
Direct Known Subclasses
Instance Attribute Summary collapse
-
#caller_id ⇒ String
readonly
Caller id.
-
#topic_name ⇒ String
readonly
Name of this topic.
-
#topic_type ⇒ Class
readonly
Class of msg.
Instance Method Summary collapse
-
#close ⇒ Object
shutdown all connections.
-
#initialize(caller_id, topic_name, topic_type) ⇒ Topic
constructor
initialize member variables.
-
#set_manager(manager) ⇒ Object
set manager for shutdown.
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_id ⇒ String (readonly)
Returns caller id.
28 29 30 |
# File 'lib/ros/topic.rb', line 28 def caller_id @caller_id end |
#topic_name ⇒ String (readonly)
Returns name of this topic.
31 32 33 |
# File 'lib/ros/topic.rb', line 31 def topic_name @topic_name end |
#topic_type ⇒ Class (readonly)
Returns class of msg.
34 35 36 |
# File 'lib/ros/topic.rb', line 34 def topic_type @topic_type end |
Instance Method Details
#close ⇒ Object
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 |