class Roby::DistributedObject

Base class for most plan-related objects (Plan, PlanObject, …)

This class contains the information and manipulation attributes that are at the core of Roby object management. In particular, it maintains the distributed object information (needed in multi-Roby setups).

Attributes

local_owner_id[R]

The ID of the local process

owners[R]

The set of Peer objects which own this object

Public Instance Methods

add_owner(owner) click to toggle source
# File lib/roby/distributed_object.rb, line 51
def add_owner(owner)
    @owners << owner
    @self_owned = @owners.include?(local_owner_id)
end
clear_owners() click to toggle source
# File lib/roby/distributed_object.rb, line 70
def clear_owners
    owners.clear
    @self_owned = true
end
owned_by?(peer_id) click to toggle source

True if the given peer owns this object

# File lib/roby/distributed_object.rb, line 62
def owned_by?(peer_id)
    if peer_id == local_owner_id
        self_owned?
    else
        owners.include?(peer_id)
    end
end
remove_owner(owner) click to toggle source
# File lib/roby/distributed_object.rb, line 56
def remove_owner(owner)
    @owners.delete(owner)
    @self_owned = @owners.empty? || @owners.include?(local_owner_id)
end