Deriving from RcfClient<>

RCF support and general discussion.
Post Reply
Raider
Posts: 12
Joined: Tue Mar 26, 2013 2:55 pm

Deriving from RcfClient<>

Post 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<>.

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Deriving from RcfClient<>

Post 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.
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

jarl
Posts: 238
Joined: Mon Oct 03, 2011 4:53 am
Contact:

Re: Deriving from RcfClient<>

Post by jarl »

This has been fixed in RCF 2.0.1.101 .
Kind Regards

Jarl Lindrud
Delta V Software
http://www.deltavsoft.com

Post Reply