46 ClassImp(RooPrintable);
49 Int_t RooPrintable::_nameLength(0) ;
52 ostream& operator<<(ostream& os,
const RooPrintable& rp) {
54 rp.printStream(os,rp.defaultPrintContents(
"I"),RooPrintable::kInline) ;
return os ;
63 void RooPrintable::nameFieldLength(Int_t newLen)
65 _nameLength = newLen>0 ? newLen : 0 ;
75 void RooPrintable::printStream(ostream& os, Int_t contents, StyleOption style, TString indent)
const
78 if (style==kVerbose||style==kStandard) {
79 printMultiline(os,contents,style==kVerbose,indent) ;
81 }
else if (style==kTreeStructure) {
82 printTree(os,indent) ;
87 if (style!=kInline) os << indent ;
90 if (contents&kAddress) {
92 if (contents!=kAddress) {
98 if (contents&kClassName) {
100 if (contents!=kClassName) {
106 if (contents&kName) {
108 os << setw(_nameLength) ;
114 if (contents&kArgs) {
119 if (contents&kValue) {
120 if (contents&kName) {
127 if (contents&kExtras) {
128 if (contents!=kExtras) {
135 if (contents&kTitle) {
136 if (contents==kTitle) {
145 if (style!=kInline) os << endl ;
155 void RooPrintable::printValue(ostream& )
const
163 void RooPrintable::printExtras(ostream& )
const
171 void RooPrintable::printMultiline(ostream& , Int_t , Bool_t , TString )
const
179 void RooPrintable::printTree(ostream& , TString )
const
181 cout <<
"Tree structure printing not implement for class " << IsA()->GetName() << endl ;
190 void RooPrintable::printArgs(ostream& )
const
198 void RooPrintable::printName(ostream& )
const
206 void RooPrintable::printTitle(ostream& )
const
214 void RooPrintable::printClassName(ostream& )
const
223 void RooPrintable::printAddress(ostream& os)
const
233 Int_t RooPrintable::defaultPrintContents(Option_t* )
const
235 return kName|kValue ;
241 RooPrintable::StyleOption RooPrintable::defaultPrintStyle(Option_t* opt)
const
250 if (o.Contains(
"v")) {
252 }
else if (o.Contains(
"s")) {
254 }
else if (o.Contains(
"i")) {
256 }
else if (o.Contains(
"t")) {
257 return kTreeStructure ;
272 ostream &RooPrintable::defaultPrintStream(ostream *os)
274 static ostream *_defaultPrintStream = &cout;
276 ostream& _oldDefault= *_defaultPrintStream;
277 if(0 != os) _defaultPrintStream= os;