Re: Serializing class with serializable members

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Wed, 28 Jan 2009 12:03:37 -0600


Hi Marc,

I do not see any different with C. What is the error you are seeing?

Cheers,
Philippe.

PS. I suppose this is just a copy/paste ommision but in the linkdef file you _must_ precede the pragma with a # character:

#pragma link C++ class A+;

#pragma link C++ class std::vector<A>+;

#pragma link C++ class B+;

#pragma link C++ class C+;

Marc de Kamps wrote:
>
> Hi,
>
>
>
> I have an issue with serialization of a class, again.
>
>
>
> I have a class A, a class B which has std::vector<A> as a private
> member and a class C which has class B as a private member, something
> like this:
>
>
>
> Class A {
>
> public:
>
>
>
> ClassDef(A,1)
>
> A();
>
>
>
> SetA(int);
>
> private:
>
>
>
> int _bla;
>
> };
>
>
>
> Class B {
>
> public:
>
>
>
> ClassDef(B,1)
>
>
>
> B();
>
>
>
> private:
>
>
>
> std::vector<A> _/vec/_bla;
>
> };
>
>
>
> Class C {
>
> public:
>
> ClassDef(C,1)
>
>
>
> C();
>
>
>
> void DoSomething();
>
>
>
> private:
>
>
>
> B _blabla;
>
> };
>
>
>
> My linkdef.h contains statements, like:
>
>
>
> pragma link C++ class A+;
>
> pragma link C++ class std::vector<A>+;
>
> pragma link C++ class B+;
>
> pragma link C++ class C+;
>
>
>
> In order to get the vector thing to work I know I have to include the
> vector dictionary
>
> gROOT->ProcessLine("#include <vector>");
>
>
>
> A and B serialize like a charm, but I can not serialize C objects. Any
> suggestions as regards the reason why?
>
>
>
> Thanks,
>
> Marc
>
> -
>
> Dr. Marc de Kamps
>
> Biosystems Group
>
> School of Computing
>
> University of Leeds
>
> LS29JT, Leeds, UK
>
>
>
> dekamps_at_comp.leeds.ac.uk <mailto:dekamps_at_comp.leeds.ac.uk>
>
> http:/www.comp.leeds.ac.uk/dekamps
>
>
>
Received on Wed Jan 28 2009 - 19:03:43 CET

This archive was generated by hypermail 2.2.0 : Wed Jan 28 2009 - 23:50:01 CET