class Roby::DRoby::V5::TaskDumper::DRoby
An intermediate representation of Task
objects suitable to be sent to our peers.
Attributes
arguments[R]
The set of dRoby-formatted arguments
data[R]
The task's internal data
flags[R]
A set of boolean flags which describe the task's status. It is a symbol => bool flag where the following parameters are save:
- started
-
if the task has started
- finished
-
if the task has finished
- success
-
if the task has finished with success
- mission
-
if the task is a mission in its plan
Public Class Methods
new(remote_siblings, owners, model, plan_id, arguments, data, **flags)
click to toggle source
Create a new DRoby
object with the given information
Calls superclass method
Roby::DRoby::V5::PlanObjectDumper::DRoby::new
# File lib/roby/droby/v5/droby_dump.rb, line 531 def initialize(remote_siblings, owners, model, plan_id, arguments, data, **flags) super(remote_siblings, owners, model, plan_id) @arguments, @data, @flags = arguments, data, flags end
Public Instance Methods
proxy(peer)
click to toggle source
Create a new proxy which maps the object of peer
represented by this communication intermediate.
# File lib/roby/droby/v5/droby_dump.rb, line 538 def proxy(peer) model = peer.local_object(self.model) arguments = peer.local_object(self.arguments) model.new(plan: local_plan(peer), **arguments) end
update(peer, task, fresh_proxy: false)
click to toggle source
Updates an already existing proxy using the information contained in this object.
Calls superclass method
Roby::DRoby::V5::DistributedObjectDumper::DRoby#update
# File lib/roby/droby/v5/droby_dump.rb, line 546 def update(peer, task, fresh_proxy: false) super task.started = flags[:started] task.finished = flags[:finished] task.success = flags[:success] if task.mission? != flags[:mission] if flags[:mission] task.plan.add_mission_task(task) else task.plan.unmark_mission_task(task) end end if !fresh_proxy task.arguments.merge!(peer.local_object(arguments)) end task.instance_variable_set("@data", peer.local_object(data)) end