(Fwd) Re: Cant list/debug pointer to a class (CINT)

From: Valery Fine (Valeri.Faine@cern.ch)
Date: Tue May 20 1997 - 16:45:04 MEST


On 20 May 97 at 15:16, Otto Schaile wrote:

> Dear roots,
> seems on cant see pointers to class with CINT.
> Suppose the following simple (working)  macro:
> 
> class TH1F;
> class XX {
> public:
>   XX();
>   void Drawhist();
>   TH1F *h1;
> };
> 
> XX::XX(){
>  h1 = new TH1F("h1","xx",10,0.,10.);
>  for (int i=0; i < 10 ; i++){ 
>    h1->Fill(i,i);
>  }
> }
> 
> XX::Drawhist(){
>  h1->Draw();
> } 
> 
> now I do:
> .L XX.C
> .b XX::Drawhist
> XX *x=new XX()
> b->Drawhist
> .l (or .g) h1
> Variable h1 not found
> 
   One needs to use ".p" for that like this:

root [10] x->Drawhist();

16   XX::Drawhist(){
17    h1->Draw();
FILE:xx.cc LINE:17 cint> .p h1  <=============== See here
(class TH1F*)0xccd798
FILE:xx.cc LINE:17 cint> .p *h1
(class TH1F)13424536
  0x0        public: TH1
    0x0        public: TNamed
      0x0        public: TObject
        0x0        private: UInt_t fUniqueID //object unique
        identifier 0x0        private: UInt_t fBits //bit field status
        word 0x0        private: static Int_t fgDirLevel //indentation
        level for ls()

        0x0        private: static Bool_t fgObjectStat //if true keep
        track of o
bjects in TObjectTable
=================================================================
Dr. Valery Fine                  Telex : 911621 dubna su
    -----------
LCTA/Joint Inst.for NuclearRes   Phone : +7 09621 6 40 80
141980 Dubna, Moscow region      Fax   : +7 09621 6 51 45
Russia                           mailto:fine@main1.jinr.dubna.su                              

Dr. Valeri Faine
    ------------                 Phone: +41 22 767 6468
CERN                             FAX  : +41 22 767 7910
CH-1211 Geneva, 23               mailto:fine@mail.cern.ch 
Switzerland                      http://nicewww.cern.ch/~fine
                                 



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