Class: Orocos::RemoteProcesses::Loader
- Inherits:
-
OroGen::Loaders::Base
- Object
- OroGen::Loaders::Base
- Orocos::RemoteProcesses::Loader
- Defined in:
- lib/orocos/remote_processes/loader.rb
Overview
A loader object that allows to load models from a remote process server
Instance Attribute Summary collapse
-
#available_deployments ⇒ Object
readonly
Returns the value of attribute available_deployments.
-
#available_projects ⇒ Object
readonly
Returns the value of attribute available_projects.
-
#available_typekits ⇒ Object
readonly
Returns the value of attribute available_typekits.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #each_available_project_name(&block) ⇒ Object
-
#find_project_from_deployment_name(name) ⇒ String?
Returns the project that defines the given deployment.
-
#has_deployment?(name) ⇒ Boolean
Tests if a deployment with that name exists.
-
#has_project?(name) ⇒ Boolean
Tests if a project with that name exists.
-
#has_typekit?(name) ⇒ Boolean
Tests if a typekit with that name exists.
-
#initialize(client, root_loader = self) ⇒ Loader
constructor
A new instance of Loader.
-
#project_model_text_from_name(name) ⇒ (String,String)
Returns the textual representation of a project model.
-
#typekit_model_text_from_name(name) ⇒ (String,String)
Returns the textual representation of a typekit.
Constructor Details
#initialize(client, root_loader = self) ⇒ Loader
Returns a new instance of Loader
12 13 14 15 16 17 18 |
# File 'lib/orocos/remote_processes/loader.rb', line 12 def initialize(client, root_loader = self) @client = client @available_projects, @available_deployments, @available_typekits = client.info super(root_loader) end |
Instance Attribute Details
#available_deployments ⇒ Object (readonly)
Returns the value of attribute available_deployments
9 10 11 |
# File 'lib/orocos/remote_processes/loader.rb', line 9 def available_deployments @available_deployments end |
#available_projects ⇒ Object (readonly)
Returns the value of attribute available_projects
8 9 10 |
# File 'lib/orocos/remote_processes/loader.rb', line 8 def available_projects @available_projects end |
#available_typekits ⇒ Object (readonly)
Returns the value of attribute available_typekits
10 11 12 |
# File 'lib/orocos/remote_processes/loader.rb', line 10 def available_typekits @available_typekits end |
#client ⇒ Object (readonly)
Returns the value of attribute client
6 7 8 |
# File 'lib/orocos/remote_processes/loader.rb', line 6 def client @client end |
Instance Method Details
#each_available_project_name(&block) ⇒ Object
84 85 86 |
# File 'lib/orocos/remote_processes/loader.rb', line 84 def each_available_project_name(&block) return available_projects.each_key(&block) end |
#find_project_from_deployment_name(name) ⇒ String?
Returns the project that defines the given deployment
76 77 78 79 80 81 82 |
# File 'lib/orocos/remote_processes/loader.rb', line 76 def find_project_from_deployment_name(name) if project_name = available_deployments[name] return project_name else raise OroGen::DeploymentModelNotFound, "#{client} has no deployment called #{name}" end end |
#has_deployment?(name) ⇒ Boolean
Tests if a deployment with that name exists
69 70 71 |
# File 'lib/orocos/remote_processes/loader.rb', line 69 def has_deployment?(name) available_deployments.has_key?(name) end |
#has_project?(name) ⇒ Boolean
Tests if a project with that name exists
53 54 55 |
# File 'lib/orocos/remote_processes/loader.rb', line 53 def has_project?(name) available_projects.has_key?(name) end |
#has_typekit?(name) ⇒ Boolean
Tests if a typekit with that name exists
61 62 63 |
# File 'lib/orocos/remote_processes/loader.rb', line 61 def has_typekit?(name) available_typekits.has_key?(name) end |
#project_model_text_from_name(name) ⇒ (String,String)
Returns the textual representation of a project model
27 28 29 30 31 32 33 |
# File 'lib/orocos/remote_processes/loader.rb', line 27 def project_model_text_from_name(name) if text = available_projects[name] return text else raise OroGen::ProjectNotFound, "#{client} has no project called #{name}, available projects: #{available_projects.keys.sort.join(", ")}" end end |
#typekit_model_text_from_name(name) ⇒ (String,String)
Returns the textual representation of a typekit
41 42 43 44 45 46 47 |
# File 'lib/orocos/remote_processes/loader.rb', line 41 def typekit_model_text_from_name(name) if text = available_typekits[name] return *text else raise OroGen::TypekitNotFound, "#{client} has no typekit called #{name}" end end |