00001 #ifndef CDBBDBTABLE_NTUPLE_P2T_HH
00002 #define CDBBDBTABLE_NTUPLE_P2T_HH
00003
00004
00005
00006
00007 #include "CdbBase/CdbObject.hh"
00008
00009 #include "CdbBdb/CdbBdbObjectConvertor.hh"
00010
00011 #include "CdbBdbTable/CdbBdbNTupleConversionImpl.hh"
00012 #include "CdbBdbTable/CdbBdbNTupleConversionRules.hh"
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 template < class ELEMENT_CONVERSION_RULES = CdbBdbNTupleConversionRules_UseDefault >
00045 class CdbBdbNTupleP2T {
00046
00047 public:
00048
00049
00050
00051
00052
00053 template < class T,
00054 unsigned int NCOL >
00055 static CdbStatus convert( CdbCPtr< CdbNTuple< T,NCOL > >& thePtr,
00056 const ooRef(BdbObject)& thePersRef )
00057 {
00058 return CdbBdbNTupleConversionImpl< T, NCOL, ELEMENT_CONVERSION_RULES >::to_transient( thePtr,
00059 thePersRef );
00060 }
00061
00062
00063
00064 template < class T,
00065 unsigned int NCOL >
00066 static CdbStatus convert( CdbNTuple< T,NCOL >*& thePtr,
00067 const ooRef(BdbObject)& thePersRef )
00068 {
00069 return CdbBdbNTupleConversionImpl< T, NCOL, ELEMENT_CONVERSION_RULES >::to_transient( thePtr,
00070 thePersRef );
00071 }
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 template < class T,
00083 unsigned int NCOL >
00084 static CdbStatus convert( CdbCPtr< CdbNTuple< T,NCOL > >& thePtr,
00085 const CdbObjectPtr& theObjectPtr )
00086 {
00087 BdbHandle(BdbObject) objectH;
00088 CdbStatus status = CdbBdbObjectConvertor::narrow( objectH,
00089 theObjectPtr );
00090 if( CdbStatus::Success != status ) return status;
00091
00092 return convert( thePtr,
00093 objectH );
00094 }
00095
00096
00097
00098 template < class T,
00099 unsigned int NCOL >
00100 static CdbStatus convert( CdbNTuple< T,NCOL >*& thePtr,
00101 const CdbObjectPtr& theObjectPtr )
00102 {
00103 BdbHandle(BdbObject) objectH;
00104 CdbStatus status = CdbBdbObjectConvertor::narrow( objectH,
00105 theObjectPtr );
00106 if( CdbStatus::Success != status ) return status;
00107
00108 return convert( thePtr,
00109 objectH );
00110 }
00111 };
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129 template < >
00130 class CdbBdbNTupleP2T< CdbBdbNTupleConversionRules_UseDefault > {
00131
00132 public:
00133
00134
00135
00136
00137 template < class T,
00138 unsigned int NCOL >
00139 static CdbStatus convert( CdbCPtr< CdbNTuple< T,NCOL > >& thePtr,
00140 const ooRef(BdbObject)& thePersRef )
00141 {
00142
00143
00144
00145 return CdbBdbNTupleP2T< CdbBdbNTupleConversionRules_Default<T> >::convert( thePtr,
00146 thePersRef );
00147 }
00148
00149
00150
00151 template < class T,
00152 unsigned int NCOL >
00153 static CdbStatus convert( CdbNTuple< T,NCOL >*& thePtr,
00154 const ooRef(BdbObject)& thePersRef )
00155 {
00156 return CdbBdbNTupleP2T< CdbBdbNTupleConversionRules_Default<T> >::convert( thePtr,
00157 thePersRef );
00158 }
00159
00160
00161
00162 template < class T,
00163 unsigned int NCOL >
00164 static CdbStatus convert( CdbCPtr< CdbNTuple< T,NCOL > >& thePtr,
00165 const CdbObjectPtr& theObjectPtr )
00166 {
00167
00168
00169
00170 return CdbBdbNTupleP2T< CdbBdbNTupleConversionRules_Default<T> >::convert( thePtr,
00171 theObjectPtr );
00172 }
00173
00174
00175
00176 template < class T,
00177 unsigned int NCOL >
00178 static CdbStatus convert( CdbNTuple< T,NCOL >*& thePtr,
00179 const CdbObjectPtr& theObjectPtr )
00180 {
00181 return CdbBdbNTupleP2T< CdbBdbNTupleConversionRules_Default<T> >::convert( thePtr,
00182 theObjectPtr );
00183 }
00184 };
00185
00186 #endif // CDBBDBTABLE_NTUPLE_P2T_HH
00187