Class: Orocos::InputWriter

Inherits:
RubyTasks::LocalOutputPort show all
Defined in:
lib/orocos/input_writer.rb

Overview

Local output port that is specifically designed to write to another task's input port

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RubyTasks::LocalOutputPort

#do_write

Instance Attribute Details

#policyObject

The policy of the connection


8
9
10
# File 'lib/orocos/input_writer.rb', line 8

def policy
  @policy
end

#portObject

The port this object is reading from


5
6
7
# File 'lib/orocos/input_writer.rb', line 5

def port
  @port
end

Instance Method Details

#disconnectObject

Disconnects this port from the port it is reading


11
12
13
# File 'lib/orocos/input_writer.rb', line 11

def disconnect
    disconnect_all
end

#write(data) ⇒ Object

Write data on the associated input port

This is only possible if the remote deployment has been started by this Ruby instance

Raises:

  • (CORBA::ComError)

    if the remote process is known to be dead.


20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/orocos/input_writer.rb', line 20

def write(data)
	    if process = port.task.process
		if !process.alive?
		    disconnect_all
		    raise CORBA::ComError, "remote end is dead"
		end
	    end
    if !super
        raise CORBA::ComError, "remote end was disconnected"
    else true
    end
end