Logo ROOT   6.12/07
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
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 &#39;enum ContentsOptions&#39; values and in the style given by &#39;enum StyleOption&#39;.
const char Option_t
Definition: RtypesCore.h:62
virtual void printClassName(std::ostream &os) const
Print class name of object.
static void nameFieldLength(Int_t newLen)
Set length of field reserved from printing name of RooAbsArgs in multi-line collection printing to gi...
Basic string class.
Definition: TString.h:125
virtual void printValue(std::ostream &os) const
Interface to print value of object.
static Int_t _nameLength
Definition: RooPrintable.h:57
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual void printAddress(std::ostream &os) const
Print class name of object.
virtual void printTree(std::ostream &os, TString indent="") const
Interface for tree structure printing of object.
#define ClassDef(name, id)
Definition: Rtypes.h:320
RooPlotable is a &#39;mix-in&#39; base class that define the standard RooFit plotting and printing methods...
Definition: RooPrintable.h:25
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
virtual void printArgs(std::ostream &os) const
Interface for printing of object arguments.
std::ostream & operator<<(std::ostream &os, const RooPrintable &rp)
virtual Int_t defaultPrintContents(Option_t *opt) const
Default choice of contents to be printed (name and value)
const Bool_t kFALSE
Definition: RtypesCore.h:88
static std::ostream & defaultPrintStream(std::ostream *os=0)
Return a reference to the current default stream to use in Print().
TCanvas * style()
Definition: style.C:1
virtual StyleOption defaultPrintStyle(Option_t *opt) const
virtual void printTitle(std::ostream &os) const
Print title of object.
virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose=kFALSE, TString indent="") const
Interface for detailed printing of object.
virtual void printExtras(std::ostream &os) const
Interface to print extras of object.
virtual void printName(std::ostream &os) const
Print name of object.
virtual ~RooPrintable()
Definition: RooPrintable.h:28