Using Boost Serialization

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

Using Boost Serialization

Post by Raider »

Hello!
I'm trying to build a RCF-2.0.1.100 with using Boost.Serialization.
I've defined RCF_USE_BOOST_SERIALIZATION for all RCFDemo projects and I modified MyService.hpp like this:

Code: Select all

#ifndef INCLUDE_MYSERVICE_HPP
#define INCLUDE_MYSERVICE_HPP

#include <string>
#include <vector>
#include <boost/serialization/vector.hpp>

#include <RCF/Idl.hpp>

// ensure RCF_USE_BOOST_SERIALIZATION is used
#ifndef RCF_USE_BOOST_SERIALIZATION
#error This is a test for RCF_USE_BOOST_SERIALIZATION
#endif

RCF_BEGIN(MyService, "MyService")
    RCF_METHOD_V1(void, reverse, std::vector<std::string> &);
RCF_END(MyService);

#endif // ! INCLUDE_MYSERVICE_HPP
But I'm getting error messages in both Client and Server projects.

Code: Select all

1>c:\users\raider\desktop\rcf-2.0.1.100\include\sf\serializer.hpp(283): error C2039: 'serialize' : is not a member of 'std::vector<_Ty>'
1>          with
1>          [
1>              _Ty=std::string
1>          ]
1>          c:\users\raider\desktop\rcf-2.0.1.100\include\sf\serializer.hpp(301) : see reference to function template instantiation 'void SF::serializeInternal<T>(SF::Archive &,T &)' being compiled
1>          with
1>          [
1>              T=U
1>          ]
...
I also get an error in case I try to use my class as a parameter:

Code: Select all

struct myvector
{
	void reverse()
	{
		// todo
	}

	template <class TArchive>
	void serialize(TArchive &Archive, const unsigned int Version)
	{
		// todo
	}
};

RCF_BEGIN(MyService, "MyService")
    RCF_METHOD_V1(void, reverse, myvector &);
RCF_END(MyService);
Error log:

Code: Select all

1>c:\users\raider\desktop\rcf-2.0.1.100\include\sf\serializer.hpp(283): error C2780: 'void myvector::serialize(TArchive &,const unsigned int)' : expects 2 arguments - 1 provided
1>          c:\users\raider\desktop\rcf-2.0.1.100\demo\myservice.hpp(23) : see declaration of 'myvector::serialize'
1>          c:\users\raider\desktop\rcf-2.0.1.100\include\sf\serializer.hpp(301) : see reference to function template instantiation 'void SF::serializeInternal<T>(SF::Archive &,T &)' being compiled
1>          with
1>          [
1>              T=U
1>          ]
...
How can I disable SF usage?

PS. Compiler is Visual C++ 2010, Boost 1.55

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

Re: Using Boost Serialization

Post by jarl »

You can disable SF by defining RCF_FEATURE_SF=0 in your build... I will change the code so that this is done automatically when RCF_USE_BOOST_SERIALIZATION is defined.
Kind Regards

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

Raider
Posts: 12
Joined: Tue Mar 26, 2013 2:55 pm

Re: Using Boost Serialization

Post by Raider »

Thank you. It works.

PS. Just want to notice you what it was OK before (in 2.0.0.2682 and 1.3).

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

Re: Using Boost Serialization

Post by jarl »

Yes... There have been some recent changes to how the configuration macros are implemented, which caused this.
Kind Regards

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

Post Reply