[ROOT] TMapFile and Shared memory problems

From: Paul M. Eugenio (eugenio@ernest.phys.cmu.edu)
Date: Fri May 05 2000 - 18:49:15 MEST


Hi,

I have been trying to use shared memory via the TMapFile.  When my producer
creates a TH1F (like as in the tutorials), my consumer is able to open the map
file, ls() its contents showing that the THF1 exist, get the hist object, and
and perform a hist->Print().   But when my producer also creates a user defined
object which inherits from TNamed,  my consumer does not see this object in the
map file unless my producer does a "Add(object,name)", and when I try to access
my object as I do for the hist object, my macro seg's.   

Are there any tricks that I am missing which would fix these problems? 
Thanks for any help..

			Paul
-- 
--
Paul M. Eugenio
Dept. of Physics
Carnegie Mellon University
(412) 268 6949
eugenio@ernest.phys.cmu.edu

---------------------------------------------- my object
class DeB : public TNamed {  
 private:
  Int_t fwptr;    // write index
  Int_t frptr;   //read index
 
 public:
  DeB();
  DeB(char *name, char *title);
  virtual ~DeB();
  void Init();
  //void Clear();
  void SetWptr(Int_t n) {fwptr = n;}
  void SetRptr(Int_t n) {frptr = n;}
  Int_t    GetWptr() const { return fwptr;}
  Int_t    GetRptr() const { return frptr;}
  void Print(ostream *os);  
  void Print();  
  
  ClassDef(DeB,1)  //Scheme of evolution;
};
-------------------------------------------- macro consumer
{
  gROOT->Reset();
   gBenchmark->Start("test_client"); 
   gSystem->Load("./libDeB.so");  

   int recieved=0;

    TMapFile *mfile = TMapFile::Create("mockdeb.map");  
   DeB *buff = 0 ;
   TH1F *hh=0;

   while (1) {
     mfile->Print();
     mfile->ls();
     hh = (TH1F *) mfile->Get("hpx", hh); 
     hh->Print();
    
     buff = (DeB *) mfile->Get("myDeb", buff);// It seg's here 
     //buff->Print();
     recieved++;
     
   }

   
   cerr<<"Received "<<recieved<<" events\n";
   gBenchmark->Show("test_client"); 
   
}



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:24 MET