The question is not the name of the method, the problem is the additional parameter which boost::serialization cannot pass to me. For this reason I have to call my own serialize method inside the standard serialize method prepared for boost::serialization.

 

template<class TArchiveType>

MyContainer::serialize(TArchiveType &rArchive, const unsigned int Version)

{

   p_variable_data->MyCustomSerialize(rArchive, Version, MyData);

}

 

NOTE that I have a pointer to the base calss and I have to call the MyCustomSerialize of the derive class. For doing this I have to simulate the mechanism already used in boost::serialization to call the standard serialization. The problem is that I don’t know how to use the get_extended_info and its related interface.

 

Thanks again.

 

Pooyan.

 

_______________________________________________________________________________________________________________________________________________________________________________

Dr. Pooyan Dadvand

Member of Kratos team

International Center for Numerical Methods in Engineering - CIMNE
Campus Norte, Edificio C1
 

c/ Gran Capitán s/n

08034 Barcelona, España

Tel:        (+34) 93 401 56 96

Fax:       (+34) 93.401.65 17

web:       www.cimne.com

              www.cimne.com/kratos/

_______________________________________________________________________________________________________________________________________________________________________________

AVISO IMPORTANTE

Los datos de carácter personal contenidos en el mensaje, se registrarán en un fichero para facilitar la gestión de las comunicaciones de CIMNE. Se pueden ejercitar los derechos de acceso, rectificación, cancelación y oposición por escrito, dirigiéndose a nuestras oficinas de CIMNE, Gran Capitán s/n,  Edificio C1 - Campus Norte UPC, 08034 Barcelona, España.

 

AVÍS IMPORTANT

Les dades de caràcter personal contingudes en aquest missatge es registraran en un fitxer per facilitar la gestió de les comunicacions del CIMNE. Es poden exercir els drets d'accés, rectificació, cancel·lació i oposició, per escrit a les nostres oficines del CIMNE, Gran Capità s/n, Edifici C1, Campus Nord UPC, 08034 Barcelona, Espanya.

 

IMPORTANT NOTICE

All personal data contained in this mail will be processed confidentially and stored in a file property of CIMNE in order to manage corporate communications. You may exercise the right of access, rectification, deletion and objection by letter sent to CIMNE, Gran Capitán, Edificio C1 - Campus Norte UPC, 08034 Barcelona, Spain.

 

 

 

 

From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Robert Ramey
Sent: 25 August 2010 18:23
To: boost-users@lists.boost.org
Subject: Re: [Boost-users] Boost Serialization callinga customserialize method

 

Pooyan Dadvand wrote:
> Hi,
>
> First of all thank you for your kind suggestion. I completely agree
> about suggested methodology for optimizing. (Indeed this is the
> methodology I use in my work) However here my concern is the
> performance in normal use of container and not in seriliaztion and
> optimizing the serialization will be a secondary objective.   
>
> What I need to know is how to call a MyCostumSerialize method of my
> derive object with an additional parameter via a pointer to the base
> class: 
>
>
> Class VariableData{
>     std::size_t m_Key;
> public:
>
>     template<class TArchiveType>
>     MyCostumSerialize(TArchiveType &rArchive, const unsigned int
> Version, void* pValue) {}
>
> };
>
> template<class TDataType>
> class Veriable : public VariableData {
> public:
>
>     template<class TArchiveType>
>     MyCostumSerialize(TArchiveType &rArchive, const unsigned int
> Version, void* pValue)
>     {
>         rArchive & static_cast<TDataType * >(pVAlue);
>     }
>
> }
>
>
> Let say I don't how to call the MyCostumSerialize method of
> "Variable" class above when I have a "VariableData*" pointer in my
> container: 
>
>
> std::vector<std::pair<const VariableData*, void*> >
>
>

Just rename MyCostumeSerialize to serialize

 

Robert Ramey