#include "RooFit.h"
#include "RooPrintable.h"
#include "Riostream.h"
#include <iomanip>
#include "TNamed.h"
ClassImp(RooPrintable)
;
Int_t RooPrintable::_nameLength(0) ;
namespace RooFit {
ostream& operator<<(ostream& os, const RooPrintable& rp) {
rp.printStream(os,rp.defaultPrintContents("I"),RooPrintable::kInline) ; return os ;
}
}
void RooPrintable::nameFieldLength(Int_t newLen)
{
_nameLength = newLen>0 ? newLen : 0 ;
}
void RooPrintable::printStream(ostream& os, Int_t contents, StyleOption style, TString indent) const
{
if (style==kVerbose||style==kStandard) {
printMultiline(os,contents,style==kVerbose,indent) ;
return ;
} else if (style==kTreeStructure) {
printTree(os,indent) ;
return ;
}
if (style!=kInline) os << indent ;
if (contents&kAddress) {
os << this ;
if (contents!=kAddress) {
os << " " ;
}
}
if (contents&kClassName) {
printClassName(os) ;
if (contents!=kClassName) {
os << "::" ;
}
}
if (contents&kName) {
if (_nameLength>0) {
os << setw(_nameLength) ;
}
printName(os) ;
}
if (contents&kArgs) {
printArgs(os) ;
}
if (contents&kValue) {
if (contents&kName) {
os << " = " ;
}
printValue(os) ;
}
if (contents&kExtras) {
if (contents!=kExtras) {
os << " " ;
}
printExtras(os) ;
}
if (contents&kTitle) {
if (contents==kTitle) {
printTitle(os) ;
} else {
os << " \"" ;
printTitle(os) ;
os << "\"" ;
}
}
if (style!=kInline) os << endl ;
}
void RooPrintable::printValue(ostream& ) const
{
}
void RooPrintable::printExtras(ostream& ) const
{
}
void RooPrintable::printMultiline(ostream& , Int_t , Bool_t , TString ) const
{
}
void RooPrintable::printTree(ostream& , TString ) const
{
}
void RooPrintable::printArgs(ostream& ) const
{
}
void RooPrintable::printName(ostream& ) const
{
}
void RooPrintable::printTitle(ostream& ) const
{
}
void RooPrintable::printClassName(ostream& ) const
{
}
Int_t RooPrintable::defaultPrintContents(Option_t* ) const
{
return kName|kValue ;
}
RooPrintable::StyleOption RooPrintable::defaultPrintStyle(Option_t* ) const
{
return kSingleLine ;
}
ostream &RooPrintable::defaultPrintStream(ostream *os) {
static ostream *_defaultPrintStream = &cout;
ostream& _oldDefault= *_defaultPrintStream;
if(0 != os) _defaultPrintStream= os;
return _oldDefault;
}
Last change: Tue May 13 17:05:40 2008
Last generated: 2008-05-13 17:05
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.