Class: Roby::DRoby::V5::EventGeneratorDumper::DRoby
- Inherits:
-
PlanObjectDumper::DRoby
- Object
- DistributedObjectDumper::DRoby
- PlanObjectDumper::DRoby
- Roby::DRoby::V5::EventGeneratorDumper::DRoby
- Defined in:
- lib/roby/droby/v5/droby_dump.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.
-
#emitted ⇒ Object
readonly
True if the generator has already been emitted once at the time EventGenerator#droby_dump has been called.
Attributes inherited from PlanObjectDumper::DRoby
Attributes inherited from DistributedObjectDumper::DRoby
Instance Method Summary collapse
-
#initialize(remote_siblings, owners, model, plan_id, controlable, emitted) ⇒ DRoby
constructor
Create a DRoby object with the given information.
-
#proxy(peer) ⇒ Object
Create a new proxy which maps the object of
peer
represented by this communication intermediate. -
#update(peer, proxy, fresh_proxy: false) ⇒ Object
Updates an already existing proxy using the information contained in this object.
Methods inherited from PlanObjectDumper::DRoby
Constructor Details
#initialize(remote_siblings, owners, model, plan_id, controlable, emitted) ⇒ DRoby
Create a DRoby object with the given information. See also PlanObject::DRoby
339 340 341 342 |
# File 'lib/roby/droby/v5/droby_dump.rb', line 339 def initialize(remote_siblings, owners, model, plan_id, controlable, emitted) super(remote_siblings, owners, model, plan_id) @controlable, @emitted = controlable, emitted end |
Instance Attribute Details
#controlable ⇒ Object (readonly)
True if the generator is controlable
332 333 334 |
# File 'lib/roby/droby/v5/droby_dump.rb', line 332 def controlable @controlable end |
#emitted ⇒ Object (readonly)
True if the generator has already been emitted once at the time EventGenerator#droby_dump has been called.
335 336 337 |
# File 'lib/roby/droby/v5/droby_dump.rb', line 335 def emitted @emitted end |
Instance Method Details
#proxy(peer) ⇒ Object
Create a new proxy which maps the object of peer
represented by this communication intermediate.
346 347 348 349 350 351 352 |
# File 'lib/roby/droby/v5/droby_dump.rb', line 346 def proxy(peer) local_object = peer.local_object(model).new(plan: local_plan(peer)) if controlable local_object.command = -> {} end local_object end |
#update(peer, proxy, fresh_proxy: false) ⇒ Object
Updates an already existing proxy using the information contained in this object.
356 357 358 359 360 361 362 |
# File 'lib/roby/droby/v5/droby_dump.rb', line 356 def update(peer, proxy, fresh_proxy: false) super if emitted && !proxy.emitted? proxy.instance_eval { @emitted = true } end end |