class OroGen::TypekitMarshallers::Corba::Plugin

Attributes

typekit[R]

Public Class Methods

name() click to toggle source
# File lib/orogen/marshallers/corba.rb, line 18
def self.name; "corba" end
new(typekit) click to toggle source
# File lib/orogen/marshallers/corba.rb, line 6
def initialize(typekit)
    @typekit = typekit

    Typelib::Type          .extend(TypekitMarshallers::Corba::Type)
    Typelib::NumericType   .extend(TypekitMarshallers::Corba::NumericType)
    Typelib::ContainerType .extend(TypekitMarshallers::Corba::ContainerType)
    Typelib::EnumType      .extend(TypekitMarshallers::Corba::EnumType)
    Typelib::CompoundType  .extend(TypekitMarshallers::Corba::CompoundType)
    Typelib::ArrayType     .extend(TypekitMarshallers::Corba::ArrayType)
    Typelib::OpaqueType    .extend(TypekitMarshallers::Corba::OpaqueType)
end

Public Instance Methods

dependencies() click to toggle source
# File lib/orogen/marshallers/corba.rb, line 21
def dependencies
    result = []
    typekit.used_typekits.each do |tk|
        next if tk.virtual?
        build_dep = Gen::RTT_CPP::BuildDependency.new(
            tk.name.upcase + "_TRANSPORT_CORBA",
            tk.pkg_transport_name('corba'))
        build_dep.in_context('corba', 'include')
        build_dep.in_context('corba', 'link')
        result << build_dep
    end
    typekit.used_libraries.each do |pkg|
        needs_link = typekit.linked_used_libraries.include?(pkg)
        result << Gen::RTT_CPP::BuildDependency.new(pkg.name.upcase, pkg.name).
            in_context('corba', 'include')
        if needs_link
            result.last.in_context('corba', 'link')
        end
    end
    result
end
generate(typesets) click to toggle source
# File lib/orogen/marshallers/corba.rb, line 45
def generate(typesets)
    headers, impl = [], []

    idl_registry = typesets.minimal_registry.dup
    opaques = idl_registry.each.find_all do |t|
        t.contains_opaques?
    end
    opaques.each do |t|
        idl_registry.remove(t)
    end
    idl_registry.clear_aliases
    
    idl = Gen::RTT_CPP.render_template "typekit", "corba", "Types.idl", binding
    idl_file = typekit.save_automatic("transports", "corba",
        "#{typekit.name}Types.idl", idl)

    code  = Gen::RTT_CPP.render_template "typekit", "corba", "Convertions.cpp", binding
    impl << typekit.save_automatic("transports", "corba",
            "Convertions.cpp", code)

    code  = Gen::RTT_CPP.render_template "typekit", "corba", "TransportPlugin.hpp", binding
    headers << typekit.save_automatic("transports", "corba",
            "TransportPlugin.hpp", code)
    code  = Gen::RTT_CPP.render_template "typekit", "corba", "TransportPlugin.cpp", binding
    impl << typekit.save_automatic("transports", "corba",
            "TransportPlugin.cpp", code)

    code_snippets = typesets.interface_types.map do |type|
        target_type = typekit.intermediate_type_for(type)
        code  = Gen::RTT_CPP.render_template "typekit", "corba", "Type.cpp", binding
        [type, code]
    end
    impl += typekit.render_typeinfo_snippets(code_snippets, "transports", "corba")

    code  = Gen::RTT_CPP.render_template "typekit", "corba", "Registration.hpp", binding
    typekit.save_automatic("transports", "corba", "Registration.hpp", code)

    impl = impl.map do |path|
        typekit.cmake_relative_path(path, "transports", "corba")
    end.sort
    headers = headers.map do |path|
        typekit.cmake_relative_path(path, "transports", "corba")
    end.sort

    pkg_config = Gen::RTT_CPP.render_template "typekit", "corba", "transport-corba.pc", binding
    typekit.save_automatic("transports", "corba", "#{typekit.name}-transport-corba.pc.in", pkg_config)
    code = Gen::RTT_CPP.render_template "typekit", "corba", "CMakeLists.txt", binding
    typekit.save_automatic("transports", "corba", "CMakeLists.txt", code)

    # We generate our own CMake code, no need to export anything to the
    # main typekit code
    return [], []
end
name() click to toggle source
# File lib/orogen/marshallers/corba.rb, line 19
def name; "corba" end
separate_cmake?() click to toggle source
# File lib/orogen/marshallers/corba.rb, line 43
def separate_cmake?; true end