Class: Roby::Distributed::DRobyTaskModel

Inherits:
DRobyModel show all
Defined in:
lib/roby/distributed/protocol.rb

Overview

Dumping intermediate for Task classes. This dumps both the ancestor list via DRobyModel and the list of task tags.

Defined Under Namespace

Modules: Dump

Instance Attribute Summary collapse

Attributes inherited from DRobyModel

#ancestors

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from DRobyModel

local_model, local_to_remote, remote_to_local, #to_s

Constructor Details

#initialize(tags, ancestors) ⇒ DRobyTaskModel

Create a DRobyTaskModel with the given tags and ancestor list



438
439
440
441
# File 'lib/roby/distributed/protocol.rb', line 438

def initialize(tags, ancestors)
    super(ancestors)
    @tags = tags
end

Instance Attribute Details

#tagsObject (readonly)

Set of task tags the task model was referring to



436
437
438
# File 'lib/roby/distributed/protocol.rb', line 436

def tags
  @tags
end

Class Method Details

._load(str) ⇒ Object

:nodoc:



474
475
476
# File 'lib/roby/distributed/protocol.rb', line 474

def self._load(str) # :nodoc:
    DRobyTaskModel.new(*Marshal.load(str)) 
end

Instance Method Details

#==(other) ⇒ Object

True if other describes the same task model than self



466
467
468
469
# File 'lib/roby/distributed/protocol.rb', line 466

def ==(other)
    super &&
 tags == other.tags
end

#_dump(lvl) ⇒ Object

:nodoc:



471
472
473
# File 'lib/roby/distributed/protocol.rb', line 471

def _dump(lvl) # :nodoc:
    @__droby_marshalled__ ||= Marshal.dump([tags, ancestors])
end

#proxy(peer) ⇒ Object

Returns or creates a Task-subclass which matches the task model described by this object



480
481
482
483
484
485
486
487
488
# File 'lib/roby/distributed/protocol.rb', line 480

def proxy(peer)
    model = super
    tags.each do |tag|
 tag = tag.proxy(nil)
 model.include tag unless model < tag
    end

    model
end