[ROOT] Problems with CINT

From: Denis Bertini (dbertini@lxg0402.gsi.de)
Date: Tue Apr 30 2002 - 20:08:57 MEST


 Hi Rooters, 
 
 
 1)

 I am facing a problem to access the pointers in my 
 event structure via CINT. I think it link to the way 
 CINT interprets level of indirection. 
 Let me explain briefly: 
 I have th following class "Composite"
 
     class Composite: public Element
      {
      protected:
      TObjArray *fEventElements;
     // something ... 
           
     // specific [] operator 
     Element& operator[](Int_t i) {
      return *static_cast<TGo4EventElement*>((*fEventElements)[i]);
    //something
     };
   
   Now with this overloaded [] operator i want to access my pointers, 
   using macros commands like:
    {
      Composite * event = new Composite(); 
      // .. initialize my structure composite
      // access one element  
      Element* sub_event= &(*event)[i][j][k];
    }  
 
   I tested this access with pure compiled C++ code and it works fine. 
   But, CINT can only access (using this syntax) one level of indirection. 
   I need to do explicitely the following trick:
 
    {
      Composite * event = new Composite();
      // .. initialize my structure composite
      // access one element
      Element* sub_event= &(((*event)[i])
                            .operator[](j))
                            .operator[](k);     
     }
   ... in order to get the correct result. But it is not very nice !

    So what am i doing wrong there?  
                                            
   2) In the last version of CINT (ROOT 303.04 22 April 2002) the
      command exit(0) hangs for ever. In root 303.02 it was working 
      correclty. 
      
                                 any hints ? 
                                            thanks
                                               Denis



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET