Module: Syskit::Models::ServiceModelsDefinitionDSL

Defined in:
lib/syskit/models/data_service.rb

Overview

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

Instance Method Summary collapse

Instance Method Details

#com_bus_type(name, parent: Syskit::ComBus, **options, &block) ⇒ Object

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.



695
696
697
698
699
# File 'lib/syskit/models/data_service.rb', line 695

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) ⇒ DataServiceModel

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.

Returns:



668
669
670
671
672
# File 'lib/syskit/models/data_service.rb', line 668

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) ⇒ Object

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.



679
680
681
682
683
# File 'lib/syskit/models/data_service.rb', line 679

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