I'm working on a C++ project where modules are meant to be combined in a small group to serve a specifi开发者_如何学编程c 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?
However I might not be understand your question right, but I believe doxygen can do that: http://www.doxygen.nl/
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.
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.
精彩评论