Class: OroGen::Loaders::TaskContext

Inherits:
BasicObject
Defined in:
lib/orogen/loaders/project.rb

Instance Method Summary collapse

Constructor Details

#initialize(load_doc, spec) ⇒ TaskContext


4
5
6
7
# File 'lib/orogen/loaders/project.rb', line 4

def initialize(load_doc, spec)
    @load_doc = load_doc
    @spec = spec
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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


9
10
11
# File 'lib/orogen/loaders/project.rb', line 9

def method_missing(m, *args, &block)
    @spec.send(m, *args, &block)
end

Instance Method Details

#__normalize_typename(type) ⇒ Object


13
14
15
16
17
18
# File 'lib/orogen/loaders/project.rb', line 13

def __normalize_typename(type)
    if type.respond_to?(:to_str)
        ::Typelib::GCCXMLLoader.cxx_to_typelib(type)
    else type
    end
end

#dynamic_input_port(name, type, *args, &block) ⇒ Object


41
42
43
44
45
46
47
48
49
50
51
# File 'lib/orogen/loaders/project.rb', line 41

def dynamic_input_port(name, type, *args, &block)
    type = if type
               __normalize_typename(type)
           end

    model = super(name, type, *args, &block)
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^dynamic_input_port/)
    end
    model
end

#dynamic_output_port(name, type, *args, &block) ⇒ Object


52
53
54
55
56
57
58
59
60
61
62
# File 'lib/orogen/loaders/project.rb', line 52

def dynamic_output_port(name, type, *args, &block)
    type = if type
               __normalize_typename(type)
           end

    model = super(name, type, *args, &block)
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^dynamic_output_port/)
    end
    model
end

#input_port(name, type, *args, &block) ⇒ Object


27
28
29
30
31
32
33
# File 'lib/orogen/loaders/project.rb', line 27

def input_port(name, type, *args, &block)
    model = super(name, __normalize_typename(type), *args, &block)
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^input_port/)
    end
    model
end

#operation(*args, &block) ⇒ Object


63
64
65
66
67
68
69
# File 'lib/orogen/loaders/project.rb', line 63

def operation(*args, &block)
    model = super
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^operation/)
    end
    model
end

#output_port(name, type, *args, &block) ⇒ Object


34
35
36
37
38
39
40
# File 'lib/orogen/loaders/project.rb', line 34

def output_port(name, type, *args, &block)
    model = super(name, __normalize_typename(type), *args, &block)
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^output_port/)
    end
    model
end

#property(name, type, *args, &block) ⇒ Object


20
21
22
23
24
25
26
# File 'lib/orogen/loaders/project.rb', line 20

def property(name, type, *args, &block)
    model = super(name, __normalize_typename(type), *args, &block)
    if @load_doc
        ::OroGen::Spec.load_documentation(model, /^property/)
    end
    model
end

#ro_ptr(typename) ⇒ Object


70
71
72
# File 'lib/orogen/loaders/project.rb', line 70

def ro_ptr(typename)
    super(__normalize_typename(typename))
end

#shared_ptr(typename) ⇒ Object


73
74
75
# File 'lib/orogen/loaders/project.rb', line 73

def shared_ptr(typename)
    super(__normalize_typename(typename))
end