ROOT  6.06/09
Reference Guide
RooNameSet.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooNameSet.h,v 1.16 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_SET
17 #define ROO_NAME_SET
18 
19 #include "TString.h"
20 #include "TObject.h"
21 #include "RooPrintable.h"
22 class RooArgSet ;
23 
24 class RooNameSet : public TObject, public RooPrintable {
25 public:
26 
27  // Constructors, assignment etc.
28  RooNameSet();
29  RooNameSet(const RooArgSet& argSet);
30  RooNameSet(const RooNameSet& other) ;
31  virtual TObject* Clone(const char*) const { return new RooNameSet(*this) ; }
32  virtual ~RooNameSet() ;
33 
34  void refill(const RooArgSet& argSet) ;
35  RooArgSet* select(const RooArgSet& list) const ;
36  Bool_t operator==(const RooNameSet& other) const;
38  Bool_t operator<(const RooNameSet& other) const ;
39 
40  virtual void printName(std::ostream& os) const ;
41  virtual void printTitle(std::ostream& os) const ;
42  virtual void printClassName(std::ostream& os) const ;
43  virtual void printValue(std::ostream& os) const ;
44 
45  inline virtual void Print(Option_t *options= 0) const {
47  }
48 
49  void setNameList(const char* givenList) ;
50  const char* content() const { return _nameList ? _nameList : ""; }
51 
52 private:
54  char* _nameList ; //[_len]
55 
56 protected:
57 
58  void extendBuffer(Int_t inc) ;
59  static void strdup(Int_t& dstlen, char* &dstbuf, const char* str);
60 
61  ClassDef(RooNameSet,1) // A sterile version of RooArgSet, containing only the names of the contained RooAbsArgs
62 };
63 
64 #endif
static void strdup(Int_t &dstlen, char *&dstbuf, const char *str)
copy src to dst, keep dstlen up to date, make sure zero length strings do not take memory ...
Definition: RooNameSet.cxx:48
virtual TObject * Clone(const char *) const
Make a clone of an object using the Streamer facility.
Definition: RooNameSet.h:31
RooNameSet()
Default constructor.
Definition: RooNameSet.cxx:61
virtual void printStream(std::ostream &os, Int_t contents, StyleOption style, TString indent="") const
Print description of object on ostream, printing contents set by contents integer, which is interpreted as an OR of 'enum ContentsOptions' values and in the style given by 'enum StyleOption'.
const char Option_t
Definition: RtypesCore.h:62
virtual void printClassName(std::ostream &os) const
Print class name of nameset.
Definition: RooNameSet.cxx:228
char * _nameList
Definition: RooNameSet.h:54
void setNameList(const char *givenList)
Definition: RooNameSet.cxx:145
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
RooNameSet & operator=(const RooNameSet &)
Assignment operator.
Definition: RooNameSet.cxx:93
virtual void Print(Option_t *options=0) const
This method must be overridden when a class wants to print itself.
Definition: RooNameSet.h:45
virtual StyleOption defaultPrintStyle(Option_t *opt) const
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual void printName(std::ostream &os) const
Print name of nameset.
Definition: RooNameSet.cxx:212
void extendBuffer(Int_t inc)
Definition: RooNameSet.cxx:127
virtual ~RooNameSet()
Destructor.
Definition: RooNameSet.cxx:85
Bool_t operator==(const RooNameSet &other) const
Comparison operator.
Definition: RooNameSet.cxx:106
virtual void printTitle(std::ostream &os) const
Print title of nameset.
Definition: RooNameSet.cxx:220
Int_t _len
Definition: RooNameSet.h:53
void refill(const RooArgSet &argSet)
Refill internal contents from names in given argSet.
Definition: RooNameSet.cxx:153
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
virtual void printValue(std::ostream &os) const
Print value of nameset, i.e the list of names.
Definition: RooNameSet.cxx:236
Mother of all ROOT objects.
Definition: TObject.h:58
const char * content() const
Definition: RooNameSet.h:50
RooArgSet * select(const RooArgSet &list) const
Construct a RooArgSet of objects in input 'list' whose names match to those in the internal name list...
Definition: RooNameSet.cxx:188
Bool_t operator<(const RooNameSet &other) const
Definition: RooNameSet.cxx:117