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)
-
- (String) caller_id
readonly
Caller id.
-
- (String) topic_name
readonly
Name of this topic.
-
- (Class) topic_type
readonly
Class of msg.
Instance Method Summary (collapse)
-
- (Object) close
shutdown all connections.
-
- (Topic) initialize(caller_id, topic_name, topic_type)
constructor
initialize member variables.
-
- (Object) set_manager(manager)
set manager for shutdown.
Constructor Details
- (Topic) initialize(caller_id, topic_name, topic_type)
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
- (String) caller_id (readonly)
Returns caller id
28 29 30 |
# File 'lib/ros/topic.rb', line 28 def caller_id @caller_id end |
- (String) topic_name (readonly)
Returns name of this topic
31 32 33 |
# File 'lib/ros/topic.rb', line 31 def topic_name @topic_name end |
- (Class) topic_type (readonly)
Returns class of msg
34 35 36 |
# File 'lib/ros/topic.rb', line 34 def topic_type @topic_type end |
Instance Method Details
- (Object) close
shutdown all connections
37 38 39 |
# File 'lib/ros/topic.rb', line 37 def close #:nodoc: @connections.each {|connection| connection.shutdown} end |
- (Object) set_manager(manager)
set manager for shutdown
43 44 45 |
# File 'lib/ros/topic.rb', line 43 def set_manager(manager) #:nodoc: @manager = manager end |