Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Move Function To Class...

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
mar10us Posted - Oct 23 2008 : 10:28:16 AM
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.
4   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Jul 18 2016 : 10:51:13 PM
case=10239 is implemented in build 2107.
feline Posted - Nov 18 2008 : 6:21:36 PM
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.
mar10us Posted - Nov 04 2008 : 05:05:46 AM
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?
feline Posted - Oct 24 2008 : 09:55:55 AM
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.

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000