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
 Implement Interface Refactor does not work on
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Apr 08 2011 :  04:22:08 AM  Show Profile  Reply with Quote
WinXP SP3, VC2008 SP1, Latest VAX.

The refactor "Implement Interface" does not work with template inheritance.

class CInterface
{
public:
	virtual InterfaceMethod() = 0 ;
} ;

template< class T_BASE > class CTemplate : public T_BASE
{
} ;

class CImplementation : public CTemplate< CInterface >
{
} ;

Place care on CTemplate or on CInterface in the inheritance declaration and try to choose "Implement Interface" from the refactor menu. No implementation suggestions for CTemplate and no menu entry for CInterface.

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Apr 08 2011 :  2:51:24 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=56625

In this case Implement Virtual Methods is working correctly for me when triggered on "CImplementation", which is something.

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

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Apr 11 2011 :  04:08:03 AM  Show Profile  Reply with Quote
Well, this is just a simplified example of ym "real" problem. If I placed caret on CImplementation in my "real" code I did not get any suggestions, not for CTemplate or CInterface. In my provided example i get the sugggestions.

The only difference I can see in short is that the classes and interfaces are in different files and some of them have additional virtual methods and/or "CTemplate" realizes some of "CInterface"s methods. So there seems to be an additional problem.
Go to Top of Page

andre.horst
Tomato Guru

Germany
150 Posts

Posted - Apr 11 2011 :  04:34:36 AM  Show Profile  Reply with Quote
Still have some problems to reproduce my real problem, but VAX does not offers virtual methods of CSuperInterface on CImplementation. Beside the different files I tried some macros, friend-decls and other stuff that could confused VAX, but it looks good. So maybe my real problem is the different files.

class CSuperInterface 
{
public:
	virtual void InterfaceMethod() const throw() = 0 ;
	virtual void SuperMethod() = 0 ; // Doe not show up in CImplementation
} ;

class CInterface : public CSuperInterface
{
public:
	CInterface():CSuperInterface(){}
	virtual void foo() = 0 ;
	virtual void bar() = 0 ;
} ;

template< class T_BASE > class CTemplate : public T_BASE
{
public:
	CTemplate():T_BASE(){}
	virtual void InterfaceMethod() const throw()
	{
	}
} ;

class CImplementation : public CTemplate< CInterface >
{
public:
	CImplementation():CTemplate(){}
	void test()
	{
	}
} ;
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
17027 Posts

Posted - Apr 11 2011 :  11:04:27 AM  Show Profile  Reply with Quote
Currently Implement Virtual Methods only checks the immediate base class, it does not scan the base class of the base class. We are looking to add this feature:

case=52138

I think you are also seeing this limitation, based on this new sample code.

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:49:43 AM  Show Profile  Reply with Quote
case=52138 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:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000