module Syskit::Models::ServiceModelsDefinitionDSL

This module is used to define the methods that allow to define module-based models (data services and friends) on Module

Public Instance Methods

com_bus_type(name, parent: Syskit::ComBus, **options, &block) click to toggle source

Creates a new communication bus model

It accepts the same arguments than device_type. In addition, the 'message_type' option must be used to specify what data type is used to represent the bus messages:

com_bus 'can', message_type: '/can/Message'

The returned value is an instance of DataServiceModel, in which ComBus is included.

# File lib/syskit/models/data_service.rb, line 649
def com_bus_type(name, parent: Syskit::ComBus, **options, &block)
    model = MetaRuby::ModelAsModule.create_and_register_submodel(self, name, parent, **options, &block)
    model.doc MetaRuby::DSLs.parse_documentation_block(/.*/, "com_bus_type")
    model
end
data_service_type(name, parent: Syskit::DataService, &block) click to toggle source

Creates a new data service model and register it on this module

If a block is given, it is used to declare the service's interface, i.e. the input and output ports that are needed on any task that provides this source.

@return [DataServiceModel] the created model

# File lib/syskit/models/data_service.rb, line 622
def data_service_type(name, parent: Syskit::DataService, &block)
    model = MetaRuby::ModelAsModule.create_and_register_submodel(self, name, parent, &block)
    model.doc MetaRuby::DSLs.parse_documentation_block(/.*/, "data_service_type")
    model
end
device_type(name, parent: Syskit::Device, &block) click to toggle source

Creates a new device model and register it on this module

The returned value is an instance of DeviceModel in which Device has been included.

# File lib/syskit/models/data_service.rb, line 633
def device_type(name, parent: Syskit::Device, &block)
    model = MetaRuby::ModelAsModule.create_and_register_submodel(self, name, parent, &block)
    model.doc MetaRuby::DSLs.parse_documentation_block(/.*/, "device_type")
    model
end