Showing calls from an internal function

Viewed 54

I want to depict something like

A::foo() { //public API
    internal();
}

A::internal() {
    B.bar()
}

So I tried

->A: foo()
A -> A :internal()
A -> B :bar()

But I end up with something like

     ,-.             ,-.      
     |A|             |B|      
     `+'             `+'      
 foo()|               |       
 ----->               |       
      |               |       
      |----.                  
      |    | internal()       
      |<---'                  
      |               |       
      |     bar()     |       
      | -------------->       
     ,+.             ,+.      
     |A|             |B|      
     `-'             `-'    

Which rather ends up denoting that bar() is invoked after completion of internal. How do I get the call to bar() to show up from within internal()?

1 Answers

You can show this with activation boxes:

->A: foo()
activate A
A -> A :internal()
activate A
A -> B :bar()
activate B
deactivate B
deactivate A
deactivate A

enter image description here

Related