Class: OroGen::Gen::RTT_CPP::OpaqueDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/orogen/gen/typekit.rb

Overview

Data structure that represents the definition for an opaque type

See Typekit#opaque_type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type, intermediate, options, code_generator) ⇒ OpaqueDefinition


518
519
520
521
522
523
524
525
# File 'lib/orogen/gen/typekit.rb', line 518

def initialize(type, intermediate, options, code_generator)
    if !type || !intermediate
        raise ArgumentError, "trying to create an opaque definition with nil types"
    end

    @type, @intermediate, @options, @code_generator =
        type, intermediate, options, code_generator
end

Instance Attribute Details

#callerObject

Backtrace at the definition point


516
517
518
# File 'lib/orogen/gen/typekit.rb', line 516

def caller
  @caller
end

#code_generatorObject (readonly)

If non-nil, this is a block which, when called, will return the C++ code needed to convert type into intermediate. If nil, it is assumed that the user will provide that code.


513
514
515
# File 'lib/orogen/gen/typekit.rb', line 513

def code_generator
  @code_generator
end

#intermediateObject (readonly)

The Typelib::Type subclass that represents the intermediate type used to marshal this opaque


507
508
509
# File 'lib/orogen/gen/typekit.rb', line 507

def intermediate
  @intermediate
end

#optionsObject (readonly)

Option hash


509
510
511
# File 'lib/orogen/gen/typekit.rb', line 509

def options
  @options
end

#typeObject (readonly)

The Typelib::Type subclass that represents this opaque


504
505
506
# File 'lib/orogen/gen/typekit.rb', line 504

def type
  @type
end

Instance Method Details

#generate_templates?Boolean

If true, the conversion function is provided by the user, and orogen should therefore generate the corresponding templates.


534
# File 'lib/orogen/gen/typekit.rb', line 534

def generate_templates?; !code_generator end

#includesObject

The set of paths that should be added to -I to the generated type to intermediate convertion.


528
# File 'lib/orogen/gen/typekit.rb', line 528

def includes; options[:include] end

#needs_copy?Boolean

If true, the opaque needs to be copied into the intermediate. If false, the convertion does not require a copy.


531
# File 'lib/orogen/gen/typekit.rb', line 531

def needs_copy?; !!options[:needs_copy] end