Logo ROOT  
Reference Guide
RooPrintable.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooPrintable.h,v 1.12 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_PRINTABLE
17 #define ROO_PRINTABLE
18 
19 
20 class TNamed ;
21 
22 #include "Rtypes.h"
23 #include "TString.h"
24 
25 class RooPrintable {
26 public:
27  inline RooPrintable() { }
28  inline virtual ~RooPrintable() { }
29 
30  // New-style printing
31 
32  // Master print function
33  enum ContentsOption { kName=1, kClassName=2, kValue=4, kArgs=8, kExtras=16, kAddress=32, kTitle=64, kCollectionHeader=128} ; // Can be ORed
34  enum StyleOption { kInline=1, kSingleLine=2, kStandard=3, kVerbose=4, kTreeStructure=5 } ; // Exclusive
35  virtual void printStream(std::ostream& os, Int_t contents, StyleOption style, TString indent="") const ;
36 
37  // Virtual hook function for class-specific content implementation
38  virtual void printAddress(std::ostream& os) const ;
39  virtual void printName(std::ostream& os) const ;
40  virtual void printTitle(std::ostream& os) const ;
41  virtual void printClassName(std::ostream& os) const ;
42  virtual void printValue(std::ostream& os) const ;
43  virtual void printArgs(std::ostream& os) const ;
44  virtual void printExtras(std::ostream& os) const ;
45  virtual void printMultiline(std::ostream& os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const ;
46  virtual void printTree(std::ostream& os, TString indent="") const ;
47 
48  static std::ostream& defaultPrintStream(std::ostream *os= 0);
49  virtual Int_t defaultPrintContents(Option_t* opt) const ;
50  virtual StyleOption defaultPrintStyle(Option_t* opt) const ;
51 
52  // Formatting control
53  static void nameFieldLength(Int_t newLen) ;
54 
55 protected:
56 
57  static Int_t _nameLength ;
58 
59  ClassDef(RooPrintable,1) // Interface for printable objects
60 
61 
62 };
63 
64 namespace RooFit {
65 std::ostream& operator<<(std::ostream& os, const RooPrintable& rp) ;
66 }
67 
68 #ifndef __CINT__
69 using RooFit::operator<< ;
70 #endif
71 
72 #endif
RooPrintable::_nameLength
static Int_t _nameLength
Definition: RooPrintable.h:57
RooPrintable::nameFieldLength
static void nameFieldLength(Int_t newLen)
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to gi...
Definition: RooPrintable.cxx:63
RooPrintable::kVerbose
@ kVerbose
Definition: RooPrintable.h:34
RooPrintable::kStandard
@ kStandard
Definition: RooPrintable.h:34
RooPrintable::printTree
virtual void printTree(std::ostream &os, TString indent="") const
Interface for tree structure printing of object.
Definition: RooPrintable.cxx:179
RooPrintable::~RooPrintable
virtual ~RooPrintable()
Definition: RooPrintable.h:28
RooPrintable::StyleOption
StyleOption
Definition: RooPrintable.h:34
indent
static void indent(ostringstream &buf, int indent_level)
Definition: TClingCallFunc.cxx:87
RooPrintable::kAddress
@ kAddress
Definition: RooPrintable.h:33
RooPrintable::printClassName
virtual void printClassName(std::ostream &os) const
Print class name of object.
Definition: RooPrintable.cxx:214
TString
Definition: TString.h:136
RooPrintable
Definition: RooPrintable.h:25
TString.h
bool
RooPrintable::ContentsOption
ContentsOption
Definition: RooPrintable.h:33
style
TCanvas * style()
Definition: style.C:1
RooPrintable::defaultPrintContents
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
Definition: RooPrintable.cxx:233
RooPrintable::kName
@ kName
Definition: RooPrintable.h:33
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
RooPrintable::printAddress
virtual void printAddress(std::ostream &os) const
Print class name of object.
Definition: RooPrintable.cxx:223
RooFit
Definition: RooCFunction1Binding.h:29
RooPrintable::defaultPrintStream
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
Definition: RooPrintable.cxx:272
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooPrintable::kCollectionHeader
@ kCollectionHeader
Definition: RooPrintable.h:33
RooPrintable::kArgs
@ kArgs
Definition: RooPrintable.h:33
RooPrintable::kValue
@ kValue
Definition: RooPrintable.h:33
RooPrintable::RooPrintable
RooPrintable()
Definition: RooPrintable.h:27
RooPrintable::printArgs
virtual void printArgs(std::ostream &os) const
Interface for printing of object arguments.
Definition: RooPrintable.cxx:190
RooPrintable::kTreeStructure
@ kTreeStructure
Definition: RooPrintable.h:34
RooPrintable::printMultiline
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
Definition: RooPrintable.cxx:171
RooPrintable::printName
virtual void printName(std::ostream &os) const
Print name of object.
Definition: RooPrintable.cxx:198
RooFit::operator<<
std::ostream & operator<<(std::ostream &os, const RooPrintable &rp)
Definition: RooPrintable.cxx:52
RooPrintable::kClassName
@ kClassName
Definition: RooPrintable.h:33
RooPrintable::kExtras
@ kExtras
Definition: RooPrintable.h:33
RooPrintable::kInline
@ kInline
Definition: RooPrintable.h:34
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooPrintable::kTitle
@ kTitle
Definition: RooPrintable.h:33
RooPrintable::printStream
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,...
Definition: RooPrintable.cxx:75
genreflex::verbose
bool verbose
Definition: rootcling_impl.cxx:133
RooPrintable::kSingleLine
@ kSingleLine
Definition: RooPrintable.h:34
RooPrintable::defaultPrintStyle
virtual StyleOption defaultPrintStyle(Option_t *opt) const
Definition: RooPrintable.cxx:241
Rtypes.h
RooPrintable::printTitle
virtual void printTitle(std::ostream &os) const
Print title of object.
Definition: RooPrintable.cxx:206
int
RooPrintable::printExtras
virtual void printExtras(std::ostream &os) const
Interface to print extras of object.
Definition: RooPrintable.cxx:163
RooPrintable::printValue
virtual void printValue(std::ostream &os) const
Interface to print value of object.
Definition: RooPrintable.cxx:155