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
 Feature Requests
 Move Function To Class...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

mar10us
New Member

5 Posts

Posted - Oct 23 2008 :  10:28:16 AM  Show Profile  Reply with Quote
I'm using VAx for refactoring C++ in both VS6 and VS2005 code and I was wandering why there isn't a option for moving a function to another class.

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Oct 24 2008 :  09:55:55 AM  Show Profile  Reply with Quote
One reason is simply that this is a very open ended feature Moving to another class that already exists? Moving to a new class? First you have to select the target class, which can be fun on its own.

Then what about moving to a derived or parent class?

You can get close by using VA Outline. Select the function or functions in VA Outline that you want to move and then cut them. Now swap to the target class / file and simply use paste.

Normally this will only move the implementation or declarations, since VA Outline only picks up the function from the current file, but if you moved the implementations you can then use Create Declaration to create the missing declarations.

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

mar10us
New Member

5 Posts

Posted - Nov 04 2008 :  05:05:46 AM  Show Profile  Reply with Quote
You can concentrate on moving (or copying) the function to an existing class. The target class is a simply a list of existing classes or maybe even a drag&drop feature? (drag function to another class, copy/move menu item, drop)

I indeed use VAoutline for this task, but i really think this feature will come in very handy.
Maybe an extra function "move back to header file" to make the function-implementation class-independent?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Nov 18 2008 :  6:21:36 PM  Show Profile  Reply with Quote
We are considering adding a feature to move the implementation to the header file:

case=10239

which might help a bit.

Moving a function from one class to another automatically though... First up selecting the right target class needs to limit the selection to the correct language. As soon as your solution uses more than one programming language this opens up some "interesting" problems.

Then you have the whole question of member variables. Quite often the required member variables will not exist in the destination class. Passing them all as parameters (like Extract Method) is unlikely to be what people want, but mapping member variables in one class to member variables in a second class is a non trivial task. I am tempted to say a nightmare task.

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Jul 18 2016 :  10:51:13 PM  Show Profile  Reply with Quote
case=10239 is implemented in build 2107.

Edited by - sean on Jul 18 2016 10:52:17 PM
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000