Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TKeyMapFile.cxx
Go to the documentation of this file.
1// @(#)root/io:$Id$
2// Author: Rene Brun 23/07/97
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12/**
13\class TKeyMapFile
14\ingroup io_files
15 Utility class for browsing TMapFile objects.
16
17 When the browser is invoked for a TMapFile, a TKeyMapFile object
18 is created for each object in the mapped file.
19 When a TKeyMapFile object is clicked in the browser, a new copy
20 of this object is copied into the local directory and the action
21 corresponding to object->Browse is executed (typically Draw).
22*/
23
24#include "TKeyMapFile.h"
25#include "TDirectory.h"
26#include "TMapFile.h"
27#include "TBrowser.h"
28
29
30////////////////////////////////////////////////////////////////////////////////
31/// Default constructor.
32
36
37////////////////////////////////////////////////////////////////////////////////
38/// Constructor.
39
40TKeyMapFile::TKeyMapFile(const char *name, const char *classname, TMapFile *mapfile)
41 : TNamed(name,classname)
42{
43 fMapFile = mapfile;
44}
45
46////////////////////////////////////////////////////////////////////////////////
47/// Browse the contained objects.
48
50{
51 TObject *obj = gDirectory->Get((char*)GetName());
52 delete obj;
53 obj = fMapFile->Get(GetName(),0);
54
55 if( b && obj )
56 obj->Browse( b );
57}
#define b(i)
Definition RSha256.hxx:100
#define gDirectory
Definition TDirectory.h:385
char name[80]
Definition TGX11.cxx:148
Using a TBrowser one can browse all ROOT objects.
Definition TBrowser.h:37
TKeyMapFile()
Default constructor.
void Browse(TBrowser *b) override
Browse the contained objects.
TMapFile * fMapFile
Pointer to map file.
Definition TKeyMapFile.h:26
This class implements a shared memory region mapped to a file.
Definition TMapFile.h:26
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
TNamed()
Definition TNamed.h:38
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition TObject.cxx:218
TObject()
TObject constructor.
Definition TObject.h:259