00001 #ifndef CDB_NTUPLE_PRINT_HH
00002 #define CDB_NTUPLE_PRINT_HH
00003
00004
00005
00006
00007 #include "CdbBase/CdbCPtr.hh"
00008
00009 #include "CdbTable/CdbNTuplePrintDefaultConverter.hh"
00010 #include "CdbTable/CdbNTuplePrintTypes.hh"
00011 #include "CdbTable/CdbNTuplePrintImpl.hh"
00012
00013 #include <iostream>
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 class CdbNTuplePrintConverter_UseDefault {
00030 };
00031
00032
00033
00034
00035
00036
00037
00038 template < class CONVERTER = CdbNTuplePrintConverter_UseDefault >
00039 class CdbNTuplePrint {
00040
00041 public:
00042
00043
00044
00045 template < class NTUPLE >
00046 static CdbStatus print( const CdbCPtr<NTUPLE>& thePtr,
00047 const unsigned int theColumnWidth,
00048 const char* theIndent,
00049 const CdbNTuplePrintTypes::FrameType theFrameType,
00050 const CdbNTuplePrintTypes::FrameBorders theFrameBorders )
00051 {
00052 return CdbNTuplePrintImpl< NTUPLE, CONVERTER >::print( std::cout,
00053 thePtr,
00054 theColumnWidth,
00055 theIndent,
00056 theFrameType,
00057 theFrameBorders );
00058 }
00059
00060
00061
00062 template < class NTUPLE >
00063 static CdbStatus print( std::ostream& theOutputStream,
00064 const CdbCPtr<NTUPLE>& thePtr,
00065 const unsigned int theColumnWidth,
00066 const char* theIndent,
00067 const CdbNTuplePrintTypes::FrameType theFrameType,
00068 const CdbNTuplePrintTypes::FrameBorders theFrameBorders )
00069 {
00070 return CdbNTuplePrintImpl< NTUPLE, CONVERTER >::print( theOutputStream,
00071 thePtr,
00072 theColumnWidth,
00073 theIndent,
00074 theFrameType,
00075 theFrameBorders );
00076 }
00077
00078
00079
00080 template < class NTUPLE >
00081 static CdbStatus print1( const CdbCPtr<NTUPLE>& thePtr,
00082 const unsigned int theColumnWidth = 12 )
00083 {
00084 return print( thePtr,
00085 theColumnWidth,
00086 " ",
00087 CdbNTuplePrintTypes::ClosedFrame,
00088 CdbNTuplePrintTypes::DoubleHashes );
00089 }
00090
00091
00092
00093 template < class NTUPLE >
00094 static CdbStatus print1( std::ostream& theOutputStream,
00095 const CdbCPtr<NTUPLE>& thePtr,
00096 const unsigned int theColumnWidth = 12 )
00097 {
00098 return print( theOutputStream,
00099 thePtr,
00100 theColumnWidth,
00101 " ",
00102 CdbNTuplePrintTypes::ClosedFrame,
00103 CdbNTuplePrintTypes::DoubleHashes );
00104 }
00105
00106
00107
00108 template < class NTUPLE >
00109 static CdbStatus print2( const CdbCPtr<NTUPLE>& thePtr,
00110 const unsigned int theColumnWidth = 12 )
00111 {
00112 return print( thePtr,
00113 theColumnWidth,
00114 " ",
00115 CdbNTuplePrintTypes::OpenFrame,
00116 CdbNTuplePrintTypes::SingleXes );
00117 }
00118
00119
00120
00121 template < class NTUPLE >
00122 static CdbStatus print2( std::ostream& theOutputStream,
00123 const CdbCPtr<NTUPLE>& thePtr,
00124 const unsigned int theColumnWidth = 12 )
00125 {
00126 return print( theOutputStream,
00127 thePtr,
00128 theColumnWidth,
00129 " ",
00130 CdbNTuplePrintTypes::OpenFrame,
00131 CdbNTuplePrintTypes::SingleXes );
00132 }
00133 };
00134
00135
00136
00137
00138
00139
00140
00141
00142 template < >
00143 class CdbNTuplePrint< CdbNTuplePrintConverter_UseDefault > {
00144
00145 public:
00146
00147 template < class NTUPLE >
00148 static CdbStatus print( const CdbCPtr<NTUPLE>& thePtr,
00149 const unsigned int theColumnWidth,
00150 const char* theIndent,
00151 const CdbNTuplePrintTypes::FrameType theFrameType,
00152 const CdbNTuplePrintTypes::FrameBorders theFrameBorders )
00153 {
00154 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print( std::cout,
00155 thePtr,
00156 theColumnWidth,
00157 theIndent,
00158 theFrameType,
00159 theFrameBorders );
00160 }
00161
00162 template < class NTUPLE >
00163 static CdbStatus print( std::ostream& theOutputStream,
00164 const CdbCPtr<NTUPLE>& thePtr,
00165 const unsigned int theColumnWidth,
00166 const char* theIndent,
00167 const CdbNTuplePrintTypes::FrameType theFrameType,
00168 const CdbNTuplePrintTypes::FrameBorders theFrameBorders )
00169 {
00170 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print( theOutputStream,
00171 thePtr,
00172 theColumnWidth,
00173 theIndent,
00174 theFrameType,
00175 theFrameBorders );
00176 }
00177
00178 template < class NTUPLE >
00179 static CdbStatus print1( const CdbCPtr<NTUPLE>& thePtr,
00180 const unsigned int theColumnWidth = 12 )
00181 {
00182 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print1( thePtr,
00183 theColumnWidth );
00184 }
00185
00186 template < class NTUPLE >
00187 static CdbStatus print1( std::ostream& theOutputStream,
00188 const CdbCPtr<NTUPLE>& thePtr,
00189 const unsigned int theColumnWidth = 12 )
00190 {
00191 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print1( theOutputStream,
00192 thePtr,
00193 theColumnWidth );
00194 }
00195
00196 template < class NTUPLE >
00197 static CdbStatus print2( const CdbCPtr<NTUPLE>& thePtr,
00198 const unsigned int theColumnWidth = 12 )
00199 {
00200 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print2( thePtr,
00201 theColumnWidth );
00202 }
00203
00204 template < class NTUPLE >
00205 static CdbStatus print2( std::ostream& theOutputStream,
00206 const CdbCPtr<NTUPLE>& thePtr,
00207 const unsigned int theColumnWidth = 12 )
00208 {
00209 return CdbNTuplePrint< CdbNTuplePrintDefaultConverter< typename NTUPLE::element_type > >::print2( theOutputStream,
00210 thePtr,
00211 theColumnWidth );
00212 }
00213 };
00214
00215 #endif // CDB_NTUPLE_PRINT_HH
00216