Verfin
Topic Author
Posts: 7
Joined: 07 Jun 2016, 11:46

C++ implementation of templated composite interfaces

07 Jun 2016, 12:02

I've done a C# wpf GUI that I'm trying to convert to C++. It would be nice to maintain two identical code pieces, so I'm trying to implement composite interface pattern. Eg.
		template <class T>
		class IIndexView : public IView, public IIndexControl<T>, public IControlParent
		{
		};
How do I Implement the Reflection in this case, if it is possible at all.
 
User avatar
jsantos
Site Admin
Posts: 2903
Joined: 20 Jan 2012, 17:18
Contact:

Re: C++ implementation of templated composite interfaces

08 Jun 2016, 17:11

As a global advice I do not recommend using NoesisGUI as a general C++ framework. If you need to convert and maintain code (non UI specific) in C++ and C# simultaneously I recommend rolling your own solution. At NoesisGUI we had to develop a C++ architecture to incorporate many of the things that are available in WPF: reflection, nullables, interfaces, etc. In 1.3 we are reducing this support to the minimal needed with the idea of reducing the size of our binaries.

Having clarified that, in our architecture we do not support interfaces inheriting from interfaces. You will have to inherit each one in a concrete class. For example:
class MyClass: public BaseComponent, public IView, public IIndexControl<T>, public IControlParent
{
}
If you provide us more detail about what you want to achieve I am sure I will be able to be more helpful.
 
Verfin
Topic Author
Posts: 7
Joined: 07 Jun 2016, 11:46

Re: C++ implementation of templated composite interfaces

09 Jun 2016, 08:33

I see. Thank you.

Who is online

Users browsing this forum: No registered users and 0 guests