[ROOT] RE: typedefs

From: Philippe Canal (pcanal@fnal.gov)
Date: Mon Nov 15 2004 - 23:20:13 MET


Hi Jonas,

There is indeed a slight problem with reading back the file in your configuration.
To work aournd the problem use:

#ifdef __CINT__
  list<UHTDecay> decayList;
#else
  DecayListType decayList;
#endif

or something equivalent.

It also turns out that I was just working in this part of the code (the
schema evolution support) to add support for automatic schema evolution
to and from TClonesArray and other STL container.

This new features (and the fix to the typedef bug you saw) will be upload
shortly in the ROOT cvs repository.  This will be part of ROOT 4.01/04

Cheers,
Philippe.

-----Original Message-----
From: owner-about-root@listserv.fnal.gov
[mailto:owner-about-root@listserv.fnal.gov]On Behalf Of
j.rademacker1@physics.ox.ac.uk
Sent: Monday, November 15, 2004 1:23 PM
To: roottalk@root.cern.ch
Cc: about-root@fnal.gov
Subject: typedefs


Hi

I made a lot of progress in my attempts to save and retrieve data to and
from a root file (Thanks Philippe!), but there is still one thing that
doesn't work, and that is handling typedefs. The symptoms are that

 o my code compiles fine
 o it saves the data to a file
 o when I want to read them, it comlains that it cannot convert a
   list<UHTDecay> to a UHTDecayList, although UHTDecayList is just a
   typedef of list<UHTDecay>.
 o Oddly, when I read the file in the same program where I write it, it
   works fine. I only have problems if I first write it, and then want
   to read it back in at another time (which is of course the point of storing
   things in a file).

 I suspect that I don't declare the typedefs right. I use ACliC to
compile my code and don't have any makefiles, LinkDef.h, etc. I put my
__CINT__ statements into my header files. They look like this:

#ifdef __MAKECINT__
#pragma link C++ typedef UHTPolyProb;
#pragma link C++ typedef UHTDecay::intervListType;
#pragma link C++ typedef UHTDecay::listOfListsType;
#pragma link C++ typedef UHTDecay::TrkIndexSetList;
#pragma link C++ typedef UHTDecay::TrkProb;
#pragma link C++ typedef UHTDecay::TrkProbList;
#pragma link C++ typedef DecayListType;
#pragma link C++ class std::set<int>+;
//#pragma link C++ class std::pair<double, double>+;
#pragma link C++ class UHTDecay::intervType+;
#pragma link C++ class std::list< UHTDecay::intervType >+;
#pragma link C++ class std::vector< std::list< UHTDecay::intervType >
>+;
#pragma link C++ class UHTDecay::TrkIndexSet+;
#pragma link C++ class std::list< UHTDecay::TrkIndexSet >+;
#pragma link C++ class std::pair< UHTDecay::TrkIndexSet,
UHTPolyWithBool<int> >+
;
#pragma link C++ class std::list<UHTLxyCut>+;
#pragma link C++ class UHTDecay+;
#pragma link C++ class std::list<UHTDecay>+;
#pragma link C++ class DecayListType+;
#endif

Greateful for any ideas,

Jonas

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Jonas Rademacker, Denys Wilkinson Bldg, Keble Road, Oxford OX1 3RH, UK
         Tel: +44-1865-273410     Fax: +44-1865-273418



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:10 MET