Class: Roby::PlanObject::DRoby

Inherits:
BasicObject::DRoby show all
Includes:
LoggedPlanObject
Defined in:
lib/roby/distributed/proxy.rb,
lib/roby/log/dot.rb,
lib/roby/log/relations.rb

Overview

Base class for all marshalled plan objects.

Direct Known Subclasses

EventGenerator::DRoby, Task::DRoby

Instance Attribute Summary collapse

Attributes included from LoggedPlanObject

#dot_id

Attributes inherited from BasicObject::DRoby

#owners, #remote_siblings

Instance Method Summary collapse

Methods included from LoggedPlanObject

#apply_layout, #dot_label, #to_dot

Methods inherited from BasicObject::DRoby

#owners_to_s, #remote_siblings_to_s, #sibling_on

Constructor Details

#initialize(remote_siblings, owners, model, plan) ⇒ DRoby

Create a DRoby object with the given information. See also BasicObject::DRoby



67
68
69
70
# File 'lib/roby/distributed/proxy.rb', line 67

def initialize(remote_siblings, owners, model, plan)
    super(remote_siblings, owners)
    @model, @plan = model, plan
end

Instance Attribute Details

#modelObject (readonly)

The model for this plan object



61
62
63
# File 'lib/roby/distributed/proxy.rb', line 61

def model
  @model
end

#planObject (readonly)

The plan of this object



63
64
65
# File 'lib/roby/distributed/proxy.rb', line 63

def plan
  @plan
end

Instance Method Details

#display(display, graphics_item) ⇒ Object



14
15
# File 'lib/roby/log/relations.rb', line 14

def display(display, graphics_item)
end

#display_create(display) ⇒ Object



11
# File 'lib/roby/log/relations.rb', line 11

def display_create(display); end

#display_eventsObject



12
# File 'lib/roby/log/relations.rb', line 12

def display_events; ValueSet.new end

#display_name(display) ⇒ Object



13
# File 'lib/roby/log/relations.rb', line 13

def display_name(display); remote_name end

#display_parentObject



10
# File 'lib/roby/log/relations.rb', line 10

def display_parent; end

#to_sObject

:nodoc:



72
73
74
# File 'lib/roby/distributed/proxy.rb', line 72

def to_s # :nodoc:
    "#<dRoby:#{model.ancestors.first.first}#{remote_siblings_to_s} plan=#{plan} owners=#{owners_to_s}>" 
end

#update(peer, proxy) ⇒ Object

Update an existing proxy, using the information stored in this DRoby object.



78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/roby/distributed/proxy.rb', line 78

def update(peer, proxy)
    super(peer, proxy)

    if proxy.root_object?
  if self.plan
      plan = peer.local_object(self.plan)
      return if proxy.plan == plan
      Distributed.update_all([plan, proxy]) do
    plan.discover(proxy)
      end
  end
    end
end