Class: Roby::EventGenerator::DRoby
- Inherits:
-
PlanObject::DRoby
- Object
- BasicObject::DRoby
- PlanObject::DRoby
- Roby::EventGenerator::DRoby
- Includes:
- Roby::EventGeneratorDisplay
- Defined in:
- lib/roby/distributed/proxy.rb,
lib/roby/log/relations.rb
Overview
An intermediate representation of EventGenerator objects suitable to be sent to our peers.
Instance Attribute Summary collapse
-
#controlable ⇒ Object
readonly
True if the generator is controlable.
-
#happened ⇒ Object
readonly
True if the generator has already been emitted once at the time EventGenerator#droby_dump has been called.
Attributes inherited from PlanObject::DRoby
Attributes included from LoggedPlanObject
Attributes inherited from BasicObject::DRoby
Instance Method Summary collapse
- #display(display, graphics_item) ⇒ Object
- #display_name(display) ⇒ Object
-
#initialize(remote_siblings, owners, model, plan, controlable, happened) ⇒ DRoby
constructor
Create a DRoby object with the given information.
-
#proxy(peer) ⇒ Object
Create a new proxy which maps the object of
peerrepresented by this communication intermediate. -
#update(peer, proxy) ⇒ Object
Updates an already existing proxy using the information contained in this object.
Methods included from Roby::EventGeneratorDisplay
#display_create, #display_time_end, #display_time_start, priorities, style, styles
Methods inherited from PlanObject::DRoby
#display_create, #display_events, #display_parent, #to_s
Methods included from LoggedPlanObject
#apply_layout, #dot_label, #to_dot
Methods inherited from BasicObject::DRoby
#owners_to_s, #remote_siblings_to_s, #sibling_on, #to_s
Constructor Details
#initialize(remote_siblings, owners, model, plan, controlable, happened) ⇒ DRoby
Create a DRoby object with the given information. See also PlanObject::DRoby
120 121 122 123 |
# File 'lib/roby/distributed/proxy.rb', line 120 def initialize(remote_siblings, owners, model, plan, controlable, happened) super(remote_siblings, owners, model, plan) @controlable, @happened = controlable, happened end |
Instance Attribute Details
#controlable ⇒ Object (readonly)
True if the generator is controlable
113 114 115 |
# File 'lib/roby/distributed/proxy.rb', line 113 def controlable @controlable end |
#happened ⇒ Object (readonly)
True if the generator has already been emitted once at the time EventGenerator#droby_dump has been called.
116 117 118 |
# File 'lib/roby/distributed/proxy.rb', line 116 def happened @happened end |
Instance Method Details
#display(display, graphics_item) ⇒ Object
93 94 95 |
# File 'lib/roby/log/relations.rb', line 93 def display(display, graphics_item) graphics_item.text.plain_text = display_name(display).to_s end |
#display_name(display) ⇒ Object
80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/roby/log/relations.rb', line 80 def display_name(display) name = if model.ancestors[0][0] != 'Roby::EventGenerator' [display.filter_prefixes(model.ancestors[0][0].dup)] else [] end if display.show_ownership name << owners_to_s end name.join("\n") end |
#proxy(peer) ⇒ Object
Create a new proxy which maps the object of peer represented by this communication intermediate.
127 128 129 130 131 132 133 |
# File 'lib/roby/distributed/proxy.rb', line 127 def proxy(peer) local_object = peer.local_object(model).new if controlable local_object.command = lambda { } end local_object end |
#update(peer, proxy) ⇒ Object
Updates an already existing proxy using the information contained in this object.
137 138 139 140 141 142 |
# File 'lib/roby/distributed/proxy.rb', line 137 def update(peer, proxy) super if happened && !proxy.happened? proxy.instance_eval { @happened = true } end end |