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
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
34{
35}
36
37////////////////////////////////////////////////////////////////////////////////
38/// Constructor.
39
40TKeyMapFile::TKeyMapFile(const char *name, const char *classname, TMapFile *mapfile)
41 : TNamed(name,classname)
42{
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
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
#define gDirectory
Definition TDirectory.h:385
char name[80]
Definition TGX11.cxx:110
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
TObject * Get(const char *name, TObject *retObj=nullptr)
Return pointer to object retrieved from shared memory.
Definition TMapFile.cxx:799
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
const char * GetName() const override
Returns name of object.
Definition TNamed.h:49
Mother of all ROOT objects.
Definition TObject.h:41
virtual void Browse(TBrowser *b)
Browse object. May be overridden for another default action.
Definition TObject.cxx:217