Module: Syskit::Models::Base

Included in:
BoundDataService, Component, Composition, DataServiceModel, Deployment
Defined in:
lib/syskit/models/base.rb

Overview

Generic module included in all classes that are used as models.

The Roby plugin uses, as Roby does, Ruby classes as model objects. To ease code reading, the model-level functionality (i.e. singleton classes) are stored in separate modules whose name finishes with Model

For instance, the singleton methods of Component are defined on ComponentModel, Composition on CompositionModel and so on.

Instance Method Summary collapse

Instance Method Details

#dependency_injection_namesObject

List of names that are valid for this model in the context of DependencyInjection



17
# File 'lib/syskit/models/base.rb', line 17

def dependency_injection_names; [] end

#pretty_print(pp) ⇒ Object



32
33
34
# File 'lib/syskit/models/base.rb', line 32

def pretty_print(pp)
    pp.text(name || "")
end

#short_nameObject

The model name that should be used in messages that are displayed to the user. Note that Syskit defines Class#short_name as an alias to #name so that #short_name can be used everywhere



22
23
24
25
26
# File 'lib/syskit/models/base.rb', line 22

def short_name
    if name then name
    else to_s
    end
end

#to_instance_requirementsSyskit::InstanceRequirements

Generates the InstanceRequirements object that represents self best



40
41
42
# File 'lib/syskit/models/base.rb', line 40

def to_instance_requirements
    Syskit::InstanceRequirements.new([self])
end

#to_sObject



28
29
30
# File 'lib/syskit/models/base.rb', line 28

def to_s
    name || super
end