[ROOT] I/O on STL vector derived class?

From: Robert Hatcher (rhatcher@SLAC.stanford.edu)
Date: Fri Nov 02 2001 - 19:31:16 MET


Hi,
  I've developed a class that derives from STL vector, ala:

#include <vector>
#include "AltListItem.h"
class AlternativeList : public vector<AltListItem*>
{
public:
  // specialized methods, eg.
  void   KeepTopChoices(UInt_t n=2, Bool_t keepOrder=false);
  Bool_t CheckConsistency() const;

  // additional member variable access
  Float_t         GetQualityFactor() const;
  void            SetQualityFactor(Float_t quality);

protected:
  Float_t         fQuality; // an overall evaluation of this collection
}

What doesn't seem to work is I/O.  If I have a TObject derived class
that has one of these as a member variable and I write it out to a
file and then read it back in then the fQuality field is correctly
restored but the vector itself is empty.  I know that I/O of vector
objects themselves works, so what would it take to make this case of
"Is A" work?

-robert

Robert W. Hatcher   | rhatcher@fnal.gov   650-840-3102
FNAL CD/CP (MINOS)  | MS 220, PO Box 500, Batavia IL 60510



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:06 MET