views:

48

answers:

2

I'm working on a C++ project where modules are meant to be combined in a small group to serve a specific purpose (in some sort of processing pipeline).

Sometimes it's hard to know the impact of any change, because we intuitively don't even know all the places where one of our module is being used.

I know I can do Search in Files to find all instances of a class, but is there a tool which can analyze my source code and give me the list of how many instances of each class is used?

+1  A: 

However I might not be understand your question right, but I believe Doxygen can do that: http://www.stack.nl/~dimitri/doxygen/

You will be able to see how everything is being used and called from what. It will give you classes calling what other classes, a whole hierarchy of your code.

Jim
Yes, or just use `grep`.
Nikolai N Fetissov
I've used doxygen before but didn't know it could do that... I will check it out again.
martin71
A: 

If all the paths through the code is known (very unlikely in reality) then putting a printf/cout in the class constructor would do the job nicely.

Otherwise, I would deploy a find-and-grep solution.

ArunSaha