Re: Getting all the objects in a TMapFile

From: Fons Rademakers (Fons.Rademakers@cern.ch)
Date: Mon Feb 15 1999 - 17:06:44 MET


Hi Alberto,

   in the soon to be released new version of ROOT I've placed the TMapRec
definition in the TMapFile.h header. For the time being proceed as described
by Otto Schaile in his reply to your posting.

Cheers, Fons.



Alberto Baldisseri wrote:
> 
> Hi rooters,
> 
>     I am trying to get all the objects in a TMapFile. I do the following to
> have
> the list of objects :
> 
>   TMapFile *mfile;
>   mfile = TMapFile::Create("hsimple.map");
>   mfile->ls();
> 
> I can access the object hpx using :  hpx    = (TH1F *) mfile->Get("hpx", hpx);
> 
> But I would like the object names ONE BY ONE to fill a list in a window
> widget.
> I take a look on the TMapFile::ls() function (see below), it uses the TMapRec
> class
> which is only for internal use of TMapFile functions (there is no .h file
> corresponding).
> 
> TMapRec *mr = GetFirst();
> while (OrgAddress(mr))
> {
>   Printf("%-20s %-20s %-10d", mr->GetName(fOffset),
>   mr->GetClassName(fOffset), mr->fBufSize);
>   mr = mr->GetNext(fOffset);
> }
> 
> What can I do ?
> 
> Regards,
> 
> Alberto
> 
> --
> +-------------------------------+------------------------------------+
> | Alberto BALDISSERI            | Tel : (33-1) 69 08 93 33           |
> | DAPNIA/SPhN, Bat 703 piece 42 | Fax : (33-1) 69 08 75 84           |
> | CEA Saclay                    | E-mail : baldiss@hep.saclay.cea.fr |
> | F 91191 Gif-sur-Yvette cedex  |                                    |
> +-------------------------------+------------------------------------+
> 
> 

-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland          Phone: +41 22 7679248
E-Mail: Fons.Rademakers@cern.ch              Fax:   +41 22 7677910



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:29 MET