Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Create Implementation for all Class methods
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

TLHobbes
Junior Member

14 Posts

Posted - Feb 11 2008 :  7:55:35 PM  Show Profile  Reply with Quote
It would be nice if one could create implementations for all class methods in one shot.

Perhaps this could be done by adding a refactoring option to Class objects like "Create Implementations" which would call "Create Implementation on each method in the class.

Example:

class Node
{
  public:
    Node();
    ~Node();

    Node* Next();
    void Blah();
};

Refactoring on the class "Node" would give the option "Create Implementions" which would implement the constructor, the destructor, Next() and Blah().

A second request to make this even better:

It would be nice if Create Implementation could detect if there was already an implementation created for a method. If not it functions as normal, else it does not create an implementation but rather it moves to the cursor to the existing implementation.

This would enhance the above request by allowing the global Create Implementations to be used to only create newly added, un-implemented class methods.


Could these things be done via scripting in VS.NET 2005? A script would need to be able to iterate through class methods and check if an implementation for a method already exists.

Thanks!

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Feb 12 2008 :  1:47:44 PM  Show Profile  Reply with Quote
We are considering allowing Create Implementation to operate on multiple methods at once:

case=1092

We are also looking into having Create Implementation check if the implementation already exists. This is slightly difficult, due to overloaded functions currently confusing VA's parser, it cannot reliably tell them apart.

case=1120

zen is the art of being at one with the two'ness
Go to Top of Page

KoenTanghe
Junior Member

24 Posts

Posted - Jun 24 2010 :  08:14:42 AM  Show Profile  Reply with Quote
Hi,
has there been any progress on case 1092?
I was just thinking the exact same thing.
I usually start with laying out my header files, and then start putting the implementations in the corresponding .cpp file.
Now, I need to do this one by one using VAX "Create implementation" on each mehtod.
Would be very nice if I could just do "Create implementation" on either the new class, or on a selection containing multiple methods. The last one would probably be the most flexible (in case you add a set of new methods to your header after you already made some).
Koen
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Jun 24 2010 :  09:09:07 AM  Show Profile  Reply with Quote
No progress yet unfortunately, but we are hoping to do this fairly soon. One idea is to use VA Outline, so you can select the methods you want to act on in the outline, and then trigger the refactoring command.

zen is the art of being at one with the two'ness
Go to Top of Page

KoenTanghe
Junior Member

24 Posts

Posted - Jun 24 2010 :  09:51:06 AM  Show Profile  Reply with Quote
feline,
that would be fine yes.
I usually work from the code text, but VA Outline is good too.
Thanks! I subscribed to this topci so I will know when it's there.
Best,
Koen
Go to Top of Page

KoenTanghe
Junior Member

24 Posts

Posted - Dec 06 2010 :  11:42:00 AM  Show Profile  Reply with Quote
Hi again,
just checking in again, as I've been doing a lot of "define class functionality in .h" --> "now implement it in .cpp" action.
Is this something that is being worked on?
Selecting the functions in the VA Outline view and then calling "create implementation" on each one of them would be very useful.
Thanks,
Koen
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Dec 08 2010 :  1:39:01 PM  Show Profile  Reply with Quote
Unfortunately this has not yet been done, but we are still looking to add this feature. As you say, it should be quite helpful, and VA Outline is a good way of specifying the methods for refactoring to work on.

zen is the art of being at one with the two'ness
Go to Top of Page

KoenTanghe
Junior Member

24 Posts

Posted - Jan 06 2011 :  04:10:52 AM  Show Profile  Reply with Quote
Best wishes for you guys! Keep up the good work!
If there's one feature I'd love to see added this year, this would be it ;-) Hope you find some time to do this.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 09 2012 :  01:43:53 AM  Show Profile  Reply with Quote
case=49162 replaces case=1092 and is implemented in build 1912

Whole Tomato Software, Inc.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Aug 09 2012 :  01:46:43 AM  Show Profile  Reply with Quote
case=1120 is implemented in build 1912

Whole Tomato Software, Inc.
Go to Top of Page

KoenTanghe
Junior Member

24 Posts

Posted - Aug 09 2012 :  04:13:21 AM  Show Profile  Reply with Quote
Great, thanks!
Go to Top of Page

GKarRacer
Ketchup Master

USA
58 Posts

Posted - Aug 17 2012 :  2:02:30 PM  Show Profile  Reply with Quote
I like this new feature, but there is one issue I have with it. I work with a lot of MFC based projects and if a class is indirectly derived from CObject and has one of the typical MFC macros like DECLARE_MESSAGE_MAP or DECLARE_DYNCREATE then the class level Create Implementation feature will implement all of the functions that are actually defined by the macros like:

static CRuntimeClass* PASCAL _GetBaseClass()
static CObject* PASCAL CreateObject()
virtual const AFX_MSGMAP* GetMessageMap() const

These functions already have implementations via the IMPLEMENT_xxx type macros in the source file. As a result you will get unnecessary and duplicate definitions.

Otherwise this feature seems to work great.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Aug 21 2012 :  11:15:40 PM  Show Profile  Reply with Quote
Personally I don't know anything about MFC, so can you help me set up a test case for this? I have created a new, default MFC application in VS2010, but doing a find in files for "CObject" does not find any matches. So if any of the generated classes are derived from CObject, it is not immediately obvious.

zen is the art of being at one with the two'ness
Go to Top of Page

azur
Senior Member

Germany
40 Posts

Posted - Aug 24 2012 :  02:31:54 AM  Show Profile  Reply with Quote
File->New->Project: "MFC Application" and <Finish> the Wizard Dialog.

Navigate to "class CViewTree : public CTreeCtrl" and call "Refactor Create Implementation": you will see "GetMessageMap" and "GetThisMessageMap".

Those methods are coming from the "DECLARE_MESSAGE_MAP"-macro.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Aug 25 2012 :  11:08:57 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description and the instructions:

case=68802

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Oct 29 2012 :  11:08:09 AM  Show Profile  Reply with Quote
case=68802 is fixed in build 1918
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000