Module: OroGen::TypekitMarshallers::Corba::OpaqueType

Defined in:
lib/orogen/marshallers/corba.rb

Instance Method Summary collapse

Instance Method Details

#from_corba(typekit, result, indent) ⇒ Object


425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/orogen/marshallers/corba.rb', line 425

def from_corba(typekit, result, indent)
    spec        = typekit.opaque_specification(self.name)
    target_type = typekit.intermediate_type_for(self)
    if spec.needs_copy?
        result << <<-EOCODE
#{target_type.cxx_name} intermediate;
if (!fromCORBA(intermediate, corba))
    return false;
#{typekit.code_fromIntermediate(target_type, true, "    ")}
        EOCODE
    else
        result << <<-EOCODE
std::auto_ptr< #{target_type.cxx_name} > intermediate(new #{target_type.cxx_name});
if (!fromCORBA(*intermediate, corba))
    return false;
#{typekit.code_fromIntermediate(target_type, false, "    ")}
        EOCODE
    end
end

#to_corba(typekit, result, indent) ⇒ Object


418
419
420
421
422
423
# File 'lib/orogen/marshallers/corba.rb', line 418

def to_corba(typekit, result, indent)
    spec        = typekit.opaque_specification(self.name)
    target_type = typekit.intermediate_type_for(self)
    result << typekit.code_toIntermediate(target_type, spec.needs_copy?, "    ")
    result << "#{indent} if (!toCORBA(corba, intermediate)) return false;"
end