0

I'm looking to create doxygen documentation for my code that includes dot graphs for function calls, but I want it to include possible function calls that are called from function objects. For example:

def main():
    funcall(Test)
    funcall(TestTwo)

def funcall(obj):
    obj()

def Test():
    print('Test')

def TestTwo():
    print('Test two')

I'd like to have a dot graph that shows a connection from main->funcall, and from funcall->Test and funcall->TestTwo. It doesn't need to be automated, if there's a way to just tell doxygen that these are existing connections and should be shown on the call graph in a cleaner way than adding if(0): Test(). Is this possible?

vityav
  • 268
  • 3
  • 14
  • 1
    This code doesn't actually work; you'll get a TypeError, because you're trying to call a string like a function. – user2357112 Apr 04 '17 at 20:48
  • 1
    Missed that, thanks. Fixed (and ran it this time just to make sure the MWE actually works) – vityav Apr 04 '17 at 20:53
  • 1
    Your approach is limited by the attempt to do the work statically. Have a look at [this answer](http://stackoverflow.com/questions/4544784/how-can-you-get-the-call-tree-with-python-profilers#23164271) for a dynamic, profiler-based approach. – aghast Apr 04 '17 at 21:14
  • Though that definitely captures everything I want, it also captures a whole lot more, and wouldn't nicely fit into doxygen documentation. Very interesting nonetheless – vityav Apr 04 '17 at 22:22

0 Answers0