Class: Orocos::Async::DelegatorDummy

Inherits:
Object
  • Object
show all
Defined in:
lib/orocos/async/object_base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parent, name, event_loop) ⇒ DelegatorDummy

Returns a new instance of DelegatorDummy



58
59
60
61
62
# File 'lib/orocos/async/object_base.rb', line 58

def initialize(parent,name,event_loop)
    @parent = parent
    @name = name
    @event_loop = event_loop
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/orocos/async/object_base.rb', line 64

def method_missing(m,*args,&block)
    return super if m == :to_ary
    error = Orocos::NotFound.new "#{@name} is not reachable while accessing #{m}"
    error.set_backtrace(Kernel.caller)
    if !block
        raise error
    else
        @event_loop.defer :on_error => @parent.method(:emit_error),:callback => block,:known_errors => Orocos::Async::KNOWN_ERRORS do
            raise error
        end
    end
end

Instance Attribute Details

#event_loopObject (readonly)

Returns the value of attribute event_loop



56
57
58
# File 'lib/orocos/async/object_base.rb', line 56

def event_loop
  @event_loop
end

#nameObject (readonly)

Returns the value of attribute name



57
58
59
# File 'lib/orocos/async/object_base.rb', line 57

def name
  @name
end