Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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