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
 CreateImplementation does no macro evaluation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Frunobulax
Ketchup Master

84 Posts

Posted - Nov 13 2007 :  07:54:36 AM  Show Profile  Reply with Quote
1614/C++ in VS2005 SP1

Hi,

if I declare
----
#define override OVERRIDE

class myClass : public myBaseClass {
[...]
virtual void doSomething(void) OVERRIDE;
};
----

and call CreateImplementation, then the implementation will look like

--
void myClass::doSomething(void) OVERRIDE
--

If I use override instead of OVERRIDE then everything is fine. (We often use OVERRIDE because there was some doxygen problem with override.)

Regards, Thomas


"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Nov 13 2007 :  08:56:51 AM  Show Profile  Reply with Quote
The problem here is that VA, and Create Implementation in particular, does not know what to do with OVERRIDE. In this specific example it is clear, but consider the code:


#ifdef UNIX
#define OVERRIDE override
#elif WIN32
#define OVERRIDE
#else
#define OVERRIDE // my custom clever macro code here
#endif

class myClass : public myBaseClass {
    virtual void doSomething(void) OVERRIDE;
};


you could try adding:

#define OVERRIDE override

at the bottom of VA's "StdAfx.h" file as explained in this FAQ entry:

http://docs.wholetomato.com?W302

This file is used to help VA's parser with difficult code, and can be used to work around odd effects. After modifying this file you need to rebuild the VA symbol database for the changes to take effect:

VA Options -> Performance -> General -> Rebuild symbol databases

Note I have not actually tried this here, so I am not sure if it will help or not in this situation.

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

Frunobulax
Ketchup Master

84 Posts

Posted - Nov 17 2007 :  08:12:29 AM  Show Profile  Reply with Quote
I doubt that "#define OVERRIDE" override is a good idea, since there is at some point "#define override OVERRIDE" in the previous code :-)

But I see your point. It's no big issue anyway.

BTW, is there a way to create multiple implementations at once? I'm certainly not the only one wo creates a signature with a number functions and needs implementations for all of them. It would also be convenient if I had a shortcut for "create implemtation", grabbing the mouse takes time.

And while we're at it, it would be nice to create a setter/getter pair for a protected or private member variable (as Eclipse does) :-)

Regards, Thomas

"The nice part about being a pessimist
is that you are constantly being either
proven right or pleasantly surprised."
(George F. Will)
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18746 Posts

Posted - Nov 17 2007 :  12:40:04 PM  Show Profile  Reply with Quote
We are considering allowing you to run Create Implementation on several functions at once:

case=1092

It is a logical extension, and a popular idea

You can assign a keyboard shortcut to the command VAssistX.CreateImplementation via the IDE's keyboard options. Personally I trigger the refactoring via Alt-X, R and then use the letter for the command I want.

Or you could bind a keyboard shortcut to VAssistX.RefactorContextMenu

Getter / setter pair, just trigger the Encapsulate Field command:

http://www.wholetomato.com/products/features/encapsulateField.asp

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

support
Whole Tomato Software

5566 Posts

Posted - Aug 09 2012 :  01:44:27 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
  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