开发者

Tool to find all instances of a class

开发者 https://www.devze.com 2023-01-23 02:20 出处:网络
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).

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号