// @(#)root/io:$Id$
// Author: Rene Brun   23/07/97

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// Utility class for browsing TMapFile objects.                         //
// When the browser is invoked for a TMapFile, a TKeyMapFile object     //
// is created for each object in the mapped file.                       //
// When a TKeyMapFile object is clicked in the browser, a new copy      //
// of this object is copied into the local directory and the action     //
// corresponding to object->Browse is executed (typically Draw).        //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TKeyMapFile.h"
#include "TDirectory.h"
#include "TMapFile.h"
#include "TBrowser.h"

ClassImp(TKeyMapFile)

//______________________________________________________________________________
TKeyMapFile::TKeyMapFile() : TNamed(), fMapFile(0)
{
   // Default constructor.
}

//______________________________________________________________________________
TKeyMapFile::TKeyMapFile(const char *name, const char *classname, TMapFile *mapfile)
      : TNamed(name,classname)
{
   // Constructor.
   fMapFile = mapfile;
}

//______________________________________________________________________________
void TKeyMapFile::Browse(TBrowser *b)
{
   // Browse the contained objects
   TObject *obj = gDirectory->Get((char*)GetName());
   delete obj;
   obj = fMapFile->Get(GetName(),0);
   
   if( b && obj )
      obj->Browse( b );
}
 TKeyMapFile.cxx:1
 TKeyMapFile.cxx:2
 TKeyMapFile.cxx:3
 TKeyMapFile.cxx:4
 TKeyMapFile.cxx:5
 TKeyMapFile.cxx:6
 TKeyMapFile.cxx:7
 TKeyMapFile.cxx:8
 TKeyMapFile.cxx:9
 TKeyMapFile.cxx:10
 TKeyMapFile.cxx:11
 TKeyMapFile.cxx:12
 TKeyMapFile.cxx:13
 TKeyMapFile.cxx:14
 TKeyMapFile.cxx:15
 TKeyMapFile.cxx:16
 TKeyMapFile.cxx:17
 TKeyMapFile.cxx:18
 TKeyMapFile.cxx:19
 TKeyMapFile.cxx:20
 TKeyMapFile.cxx:21
 TKeyMapFile.cxx:22
 TKeyMapFile.cxx:23
 TKeyMapFile.cxx:24
 TKeyMapFile.cxx:25
 TKeyMapFile.cxx:26
 TKeyMapFile.cxx:27
 TKeyMapFile.cxx:28
 TKeyMapFile.cxx:29
 TKeyMapFile.cxx:30
 TKeyMapFile.cxx:31
 TKeyMapFile.cxx:32
 TKeyMapFile.cxx:33
 TKeyMapFile.cxx:34
 TKeyMapFile.cxx:35
 TKeyMapFile.cxx:36
 TKeyMapFile.cxx:37
 TKeyMapFile.cxx:38
 TKeyMapFile.cxx:39
 TKeyMapFile.cxx:40
 TKeyMapFile.cxx:41
 TKeyMapFile.cxx:42
 TKeyMapFile.cxx:43
 TKeyMapFile.cxx:44
 TKeyMapFile.cxx:45
 TKeyMapFile.cxx:46
 TKeyMapFile.cxx:47
 TKeyMapFile.cxx:48
 TKeyMapFile.cxx:49
 TKeyMapFile.cxx:50
 TKeyMapFile.cxx:51
 TKeyMapFile.cxx:52
 TKeyMapFile.cxx:53
 TKeyMapFile.cxx:54