Logo ROOT   6.12/07
Reference Guide
RooNameReg.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooNameReg.h,v 1.3 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_NAME_REG
17 #define ROO_NAME_REG
18 
19 #include "TNamed.h"
20 #include "RooHashTable.h"
21 #include "RooLinkedList.h"
22 
23 class RooNameReg : public TNamed {
24 public:
25 
26  static RooNameReg& instance() ;
27  virtual ~RooNameReg();
28  const TNamed* constPtr(const char* stringPtr) ;
29  const char* constStr(const TNamed* namePtr) ;
30  static const TNamed* ptr(const char* stringPtr) ;
31  static const char* str(const TNamed* ptr) ;
32  static const TNamed* known(const char* stringPtr) ;
33 
34  static void cleanup() ;
35 
36  enum {
37  kRenamedArg = BIT(19) // TNamed flag to indicate that some RooAbsArg has been renamed (flag set in new name)
38  };
39 
40 protected:
41 
43 
44  RooNameReg(Int_t hashSize = 31) ;
45  RooNameReg(const RooNameReg& other) ;
46 
47  RooHashTable _htable ; // Repository of registered names
49 
50  ClassDef(RooNameReg,1) // String name registry
51 };
52 
53 #endif
54 
55 
static const char * str(const TNamed *ptr)
Return C++ string corresponding to given TNamed pointer.
Definition: RooNameReg.cxx:135
#define BIT(n)
Definition: Rtypes.h:78
int Int_t
Definition: RtypesCore.h:41
static void cleanup()
Cleanup function called by atexit() handler installed by RooSentinel to delete global objects on heap...
Definition: RooNameReg.cxx:78
#define ClassDef(name, id)
Definition: Rtypes.h:320
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
RooLinkedList _list
Definition: RooNameReg.h:48
RooHashTable implements a hash table for TObjects.
Definition: RooHashTable.h:28
static const TNamed * known(const char *stringPtr)
If the name is already known, return its TNamed pointer. Otherwise return 0 (don't register the name)...
Definition: RooNameReg.cxx:145
static RooNameReg & instance()
Return reference to singleton instance.
Definition: RooNameReg.cxx:64
static const TNamed * ptr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:125
virtual ~RooNameReg()
Destructor.
Definition: RooNameReg.cxx:47
RooLinkedList is an collection class for internal use, storing a collection of RooAbsArg pointers in ...
Definition: RooLinkedList.h:35
RooNameReg(Int_t hashSize=31)
Definition: RooNameReg.cxx:42
RooHashTable _htable
Definition: RooNameReg.h:47
RooNameReg is a registry for 'const char*' name.
Definition: RooNameReg.h:23
const TNamed * constPtr(const char *stringPtr)
Return a unique TNamed pointer for given C++ string.
Definition: RooNameReg.cxx:91
static RooNameReg * _instance
Definition: RooNameReg.h:42
const char * constStr(const TNamed *namePtr)
Return C++ string corresponding to given TNamed pointer.
Definition: RooNameReg.cxx:115