class Orocos::RemoteProcesses::Loader

A loader object that allows to load models from a remote process server

Attributes

available_deployments[R]
available_projects[R]
available_typekits[R]
client[R]

Public Class Methods

new(client, root_loader = self) click to toggle source
Calls superclass method
# 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

Public Instance Methods

each_available_project_name(&block) click to toggle source
# 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) click to toggle source

Returns the project that defines the given deployment

@param [String] deployment_name the deployment we are looking for @return [String,nil]

# 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) click to toggle source

Tests if a deployment with that name exists

@param [String] name the deployment name @return [Boolean]

# File lib/orocos/remote_processes/loader.rb, line 69
def has_deployment?(name)
    available_deployments.has_key?(name)
end
has_project?(name) click to toggle source

Tests if a project with that name exists

@param [String] name the project name @return [Boolean]

# File lib/orocos/remote_processes/loader.rb, line 53
def has_project?(name)
    available_projects.has_key?(name)
end
has_typekit?(name) click to toggle source

Tests if a typekit with that name exists

@param [String] name the typekit name @return [Boolean]

# 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) click to toggle source

Returns the textual representation of a project model

@param [String] the project name @raise [OroGen::NotFound] if there is no project with that

name.

@return [(String,String)] the model as text, as well as a path to

the model file (or nil if there is no such file)
# 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) click to toggle source

Returns the textual representation of a typekit

@param [String] the typekit name @raise [OroGen::NotFound] if there is no typekit with that name @return [(String,String)] the typekit registry as XML and the

typekit's typelist
# 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