Class: Roby::Queries::TransactionQueryResult::ReachabilityVisitor
- Inherits:
-
RGL::DFSVisitor
- Object
- RGL::DFSVisitor
- Roby::Queries::TransactionQueryResult::ReachabilityVisitor
- Defined in:
- lib/roby/queries/transaction_query_result.rb
Instance Method Summary collapse
- #follow_edge?(u, v) ⇒ Boolean
- #handle_examine_vertex(v) ⇒ Object
- #handle_start_vertex(v) ⇒ Object
-
#initialize(graph, up_plan, up_seeds, this_set, down_plan, down_seeds) ⇒ ReachabilityVisitor
constructor
A new instance of ReachabilityVisitor.
Constructor Details
#initialize(graph, up_plan, up_seeds, this_set, down_plan, down_seeds) ⇒ ReachabilityVisitor
Returns a new instance of ReachabilityVisitor.
73 74 75 76 77 78 79 80 |
# File 'lib/roby/queries/transaction_query_result.rb', line 73 def initialize(graph, up_plan, up_seeds, this_set, down_plan, down_seeds) super(graph) @up_plan = up_plan @up_seeds = up_seeds @this_set = this_set @down_plan = down_plan @down_seeds = down_seeds end |
Instance Method Details
#follow_edge?(u, v) ⇒ Boolean
86 87 88 89 90 91 |
# File 'lib/roby/queries/transaction_query_result.rb', line 86 def follow_edge?(u, v) !@down_plan || !( @down_plan.find_local_object_for_task(u) && @down_plan.find_local_object_for_task(v) ) end |
#handle_examine_vertex(v) ⇒ Object
93 94 95 96 97 98 99 100 101 |
# File 'lib/roby/queries/transaction_query_result.rb', line 93 def handle_examine_vertex(v) if (@start_vertex != v) && @this_set.include?(v) throw :reachable, true elsif (proxy = @down_plan&.find_local_object_for_task(v)) @down_seeds << proxy elsif v.transaction_proxy? @up_seeds << v.__getobj__ end end |
#handle_start_vertex(v) ⇒ Object
82 83 84 |
# File 'lib/roby/queries/transaction_query_result.rb', line 82 def handle_start_vertex(v) @start_vertex = v end |