Page 1 of 1

C++ implementation of templated composite interfaces

Posted: 07 Jun 2016, 12:02
by Verfin
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.

Re: C++ implementation of templated composite interfaces

Posted: 08 Jun 2016, 17:11
by jsantos
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.

Re: C++ implementation of templated composite interfaces

Posted: 09 Jun 2016, 08:33
by Verfin
I see. Thank you.