Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » How to quickly find a definition of a method, which derives after pure virtual function
How to quickly find a definition of a method, which derives after pure virtual function [message #1005904] Tue, 29 January 2013 09:22 Go to next message
W P is currently offline W PFriend
Messages: 2
Registered: January 2013
Junior Member
I am rather new to C++, I coded mainly in C, so sorry if it's obvious for you. I would like to know, what's the quickes way, to get me to definition of a class method.

I can see a reference to a method (calling a function), I hold Ctrl key and click on it and it takes me to a it's pure virtual declaration in base class. What I would like to see now, is a definition of the method.

I agree, there might be as many of those, as there are classes deriving from base one, as they all have to provide a method, because it's pure virtual, but at least it should list them, shouldn't it? So, I used simple text search, which listed around 30 places...
Re: How to quickly find a definition of a method, which derives after pure virtual function [message #1006102 is a reply to message #1005904] Tue, 29 January 2013 22:03 Go to previous messageGo to next message
Jesse Weinstein is currently offline Jesse WeinsteinFriend
Messages: 44
Registered: July 2012
Member
Ctrl-G (or context menu > Declarations > Workspace) will bring up a search of all the Declarations and definitions of the function name under the cursor. That sounds like what you are asking for. Feel free to reply if I didn't understand you correctly.
Re: How to quickly find a definition of a method, which derives after pure virtual function [message #1006131 is a reply to message #1005904] Wed, 30 January 2013 06:45 Go to previous messageGo to next message
Andrey Eremchenko is currently offline Andrey EremchenkoFriend
Messages: 7
Registered: July 2009
Junior Member
W P wrote on Tue, 29 January 2013 04:22
I agree, there might be as many of those, as there are classes deriving from base one, as they all have to provide a method, because it's pure virtual, but at least it should list them, shouldn't it?

Just press Ctrl+T when the cursor is on the call of this virtual function.
Re: How to quickly find a definition of a method, which derives after pure virtual function [message #1006197 is a reply to message #1006131] Wed, 30 January 2013 12:24 Go to previous messageGo to next message
W P is currently offline W PFriend
Messages: 2
Registered: January 2013
Junior Member
CTRL+G does not help, takes me to a base class definition, in which there is a declaration of this pure virtual method, so the same effect as CTRL+Click.

CTRL+T on the other hand lists classes that derive from it and after clicking on one of those it takes me to derived class definition. Many thanks for that, this one is helpful and better than text search, as at least I can see classes which have defined this method. But still class definition is in .h file and it's method definition in cpp file, so there has to be several jumps before reaching each method.

So right now it's like:
CTRL+T -> Click on derived class -> find method declaration -> CTRL+C(copy method's name) -> CTRL+TAB (go to cpp file) -> CTRL+F(find method in cpp file) -> CTRL+V (paste name of the method) -> Enter

Surely it can be done quicker, like after CTRL+T it would not only list classes but also under each class, would show method under which the mouse pointer is. Any other ides?
Re: How to quickly find a definition of a method, which derives after pure virtual function [message #1006246 is a reply to message #1006197] Wed, 30 January 2013 14:57 Go to previous messageGo to next message
Andrey Eremchenko is currently offline Andrey EremchenkoFriend
Messages: 7
Registered: July 2009
Junior Member
W P wrote on Wed, 30 January 2013 07:24
So right now it's like:
CTRL+T -> Click on derived class -> find method declaration -> CTRL+C(copy method's name) -> CTRL+TAB (go to cpp file) -> CTRL+F(find method in cpp file) -> CTRL+V (paste name of the method) -> Enter

Ctrl+T shows classes that override virtual function, and selection of class brings you exactly to the implementation of the overridden function (usually inside cpp).
Re: How to quickly find a definition of a method, which derives after pure virtual function [message #1149973 is a reply to message #1005904] Tue, 22 October 2013 12:46 Go to previous message
Peter Protsenco is currently offline Peter ProtsencoFriend
Messages: 1
Registered: October 2013
Junior Member
Consider yourselfs lucky. As for me, in my freshly downloaded Eclipse-based Code Composer Studio 5.5.0 from Texas Instruments neither of these combinations work. So it seems I have to text search lots of header files manually Sad I really miss Ctrl+mouseclicking that I did in long since forgotten previos century IDEs.
Previous Topic:[Photran] Preprocessor Symbols
Next Topic:GDB Hardware debugging feature gets lost
Goto Forum:
  


Current Time: Fri Nov 28 19:39:15 GMT 2014

Powered by FUDForum. Page generated in 0.06438 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software