Class: OroGen::Spec::Typekit::OpaqueInfoListener

Inherits:
Object
  • Object
show all
Includes:
REXML::StreamListener
Defined in:
lib/orogen/spec/typekit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(typekit_registry) ⇒ OpaqueInfoListener

Returns a new instance of OpaqueInfoListener



50
51
52
53
54
# File 'lib/orogen/spec/typekit.rb', line 50

def initialize(typekit_registry)
    @registry = Typelib::Registry.new
    @typekit_registry = typekit_registry
    @opaques = Array.new
end

Instance Attribute Details

#opaquesObject (readonly)

Returns the value of attribute opaques



48
49
50
# File 'lib/orogen/spec/typekit.rb', line 48

def opaques
  @opaques
end

#registryObject (readonly)

Returns the value of attribute registry



48
49
50
# File 'lib/orogen/spec/typekit.rb', line 48

def registry
  @registry
end

#typekit_registryObject (readonly)

Returns the value of attribute typekit_registry



48
49
50
# File 'lib/orogen/spec/typekit.rb', line 48

def typekit_registry
  @typekit_registry
end

Instance Method Details

#tag_start(name, attributes) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/orogen/spec/typekit.rb', line 56

def tag_start(name, attributes)
    return if name != 'opaque'
    base_type_name  = attributes['name']
    inter_type_name = attributes['marshal_as']
    includes        = attributes['includes']
    needs_copy      = attributes['needs_copy']
    opaques << OpaqueDefinition.new(
        typekit_registry.get(base_type_name),
        inter_type_name,
        Hash[include: includes.split(':'), needs_copy: (needs_copy == '1')],
        nil)
    registry.merge(typekit_registry.minimal(base_type_name))
end