Class: Syskit::Coordination::OutputPort

Inherits:
OutputPort show all
Defined in:
lib/syskit/coordination/port_handling.rb

Instance Attribute Summary

Attributes inherited from Port

#component, #model

Instance Method Summary collapse

Methods inherited from OutputPort

#each_concrete_connection, #each_connection, #output?, #to_data_source

Methods inherited from Port

#==, #connect_to, #connected?, #connected_to?, #disconnect_from, #eql?, #hash, #initialize, #input?, #inspect, #name, #new_sample, #output?, #pretty_print, #static?, #to_actual_port, #to_component_port, #to_orocos_port, #to_s, #type

Constructor Details

This class inherits a constructor from Syskit::Port

Instance Method Details

#reader(policy = Hash.new) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/syskit/coordination/port_handling.rb', line 42

def reader(policy = Hash.new)
    # The 'rescue' case is used only on first evaluation of the
    # block, when Roby instanciates it to check syntax.
    # The script blocks have to be re-instanciated for each
    # task they get applied on
    begin
        component.resolve
        root_task = component.root_task.resolve
        reader = super
        root_task.stop_event.on { |_| reader.disconnect }
        reader
    rescue Roby::Coordination::ResolvingUnboundObject
        Syskit::Models::OutputReader.new(self, policy)
    end
end