Class: Orocos::Log::OutputPort::Connection
- Inherits:
-
Object
- Object
- Orocos::Log::OutputPort::Connection
- Defined in:
- lib/orocos/log/task_context.rb
Overview
Defines a connection which is set through connect_to
Instance Attribute Summary collapse
-
#filter ⇒ Object
Returns the value of attribute filter.
-
#log_port ⇒ Object
Returns the value of attribute log_port.
-
#port ⇒ Object
Returns the value of attribute port.
-
#writer ⇒ Object
Returns the value of attribute writer.
Instance Method Summary collapse
-
#initialize(log_port, port, policy = Hash.new) ⇒ Connection
constructor
A new instance of Connection.
- #update ⇒ Object
Constructor Details
#initialize(log_port, port, policy = Hash.new) ⇒ Connection
Returns a new instance of Connection
231 232 233 234 235 236 237 238 |
# File 'lib/orocos/log/task_context.rb', line 231 def initialize(log_port,port,policy=Hash.new) @log_port = log_port @port = port policy = OutputPort::default_policy if !policy @filter, policy = Kernel.(policy,[:filter]) @filter = @filter[:filter] @writer = port.writer(policy) end |
Instance Attribute Details
#filter ⇒ Object
Returns the value of attribute filter
230 231 232 |
# File 'lib/orocos/log/task_context.rb', line 230 def filter @filter end |
#log_port ⇒ Object
Returns the value of attribute log_port
230 231 232 |
# File 'lib/orocos/log/task_context.rb', line 230 def log_port @log_port end |
#port ⇒ Object
Returns the value of attribute port
230 231 232 |
# File 'lib/orocos/log/task_context.rb', line 230 def port @port end |
#writer ⇒ Object
Returns the value of attribute writer
230 231 232 |
# File 'lib/orocos/log/task_context.rb', line 230 def writer @writer end |
Instance Method Details
#update ⇒ Object
240 241 242 243 244 245 246 247 |
# File 'lib/orocos/log/task_context.rb', line 240 def update data = log_port.raw_read if @filter @writer.write(@filter.call data) else @writer.write(data) end end |