Page 1 of 1

Deriving from RcfClient<>

Posted: Thu Jun 26, 2014 11:26 am
by Raider
The following code compiles with RCF 2.0.0.2682 and 1.3.1, but does not compile with the current 2.0.1.100 version.

Code: Select all

class Client : public RcfClient<MyService>
{
public:
	Client(RCF::Endpoint const &Endpoint) : public RcfClient<MyService>(Endpoint) {}
};
Error log (VS 2010):

Code: Select all

error C2512: 'RCF::I_RcfClient::I_RcfClient' : no appropriate default constructor available
I try to hide an implementation of a client and provide such header file:

Code: Select all

// SomeClass.h

class CClient;

class CSomeClass
{
//...

private:
	std::vector<CClient*> v;
}
and include implementation (and dependancy of RCF) only in .cpp file.
So, I need to derive my class from RcfClient<>.

Re: Deriving from RcfClient<>

Posted: Sun Aug 10, 2014 12:14 pm
by jarl
I tracked this down to the RcfClient<> using virtual inheritance. If you comment out the virtual in this line in RCF\include\RCF\Idl.hpp, around line 87:

Code: Select all

        public /*virtual*/ ::RCF::I_RcfClient                                   \
, your code should compile and work. The 'virtual' was originally put in in order to support deriving from multiple RcfClient<> classes, but that's not really relevant any more. You can remove it without any ill effects.

Re: Deriving from RcfClient<>

Posted: Sun Sep 07, 2014 6:13 am
by jarl
This has been fixed in RCF 2.0.1.101 .