Class: Roby::DelayedArgument

Inherits:
Object
  • Object
show all
Defined in:
lib/roby/task_arguments.rb

Overview

Documentation of the delayed argument interface

This is not meant to be used directly

Instance Method Summary collapse

Instance Method Details

#can_merge?(task, other_task, other_arg) ⇒ Boolean

Tests the possibility to merge this with another delayed argument

This tests whether this arguemnt, in the context of task, could be merged with another argument when evaluated in the context of another task

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


499
500
501
# File 'lib/roby/task_arguments.rb', line 499

def can_merge?(task, other_task, other_arg)
    raise NotImplementedError
end

#evaluate_delayed_argument(task) ⇒ Object

Evaluate this delayed argument in the context of the given task

It should either return a plain object (which may be nil) or throw :no_value to indicate that it cannot be evaluated (yet)

Raises:

  • (NotImplementedError)


490
491
492
# File 'lib/roby/task_arguments.rb', line 490

def evaluate_delayed_argument(task)
    raise NotImplementedError
end

#merge(task, other_task, other_arg) ⇒ Object

Merge this argument with another

The method may assume that #can_merge? has been called and returned true

Returns:

  • (Object)

    the merged argument, which may be a delayed argument itself.

Raises:

  • (NotImplementedError)


510
511
512
# File 'lib/roby/task_arguments.rb', line 510

def merge(task, other_task, other_arg)
    raise NotImplementedError
end

#pretty_print(pp) ⇒ Object

Pretty-print this delayed argument

Roby uses the pretty-print mechanism to build most of its error messages, so it is better to implement the #pretty_print method for custom delayed arguments



484
# File 'lib/roby/task_arguments.rb', line 484

def pretty_print(pp); end

#strong?Boolean

Whether the argument represents a default (weak) or a real value (strong)

Strong arguments automatically override weak ones during merge

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


517
518
519
# File 'lib/roby/task_arguments.rb', line 517

def strong?
    raise NotImplementedError
end