![]() |
|
|
Bdb packages | Design docs | Source docs | Guidelines | Recent releases |
|
Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Compound Members File Members /BdbEvent/BdbHdrAccessP.hh
Go to the documentation of this file.00001 //-------------------------------------------------------------------------- 00002 // File and Version Information: 00003 // $Id: BdbHdrAccessP.hh,v 1.1 1999/04/17 15:08:07 quarrie Exp $ 00004 // 00005 // Description: 00006 // Front end for BdbGenericHdrPP classes. 00007 // 00008 // Author List: 00009 // David R. Quarrie Lawrence Berkeley National Laboratory 00010 // 00011 // 00012 //------------------------------------------------------------------------ 00013 #ifndef BDBHDRACCESSP_HH 00014 #define BDBHDRACCESSP_HH 00015 00016 //---------------------------------------------- 00017 // Collaborating Class Headers & Declarations -- 00018 //---------------------------------------------- 00019 #ifndef BDB_HH 00020 #include "BdbUtil/Bdb.hh" 00021 #endif 00022 #include "BdbEvent/BdbGenericHdrP.hh" 00023 00024 // ---------------------- 00025 // -- Class Interfaces -- 00026 // ---------------------- 00027 00028 template <class T> 00029 class BdbHdrAccessP { 00030 00031 //------------------ 00032 // Static Members -- 00033 //------------------ 00034 00035 public: 00036 00037 static BdbRef(T) get( const BdbRef(BdbGenericHdrP)& theHdr ); 00038 static BdbRef(T) get( const BdbRef(BdbGenericHdrP)& theHdr, const char* const theKey ); 00039 static BdbStatus get( const BdbRef(BdbGenericHdrP)& theHdr, BdbRef(T)& theObj ); 00040 static BdbStatus get( const BdbRef(BdbGenericHdrP)& theHdr, BdbRef(T)& theObj, const char* const theKey ); 00041 static BdbStatus get( const BdbRef(BdbGenericHdrP)& theHdr, BdbHandle(T)& theObj ); 00042 static BdbStatus get( const BdbRef(BdbGenericHdrP)& theHdr, BdbHandle(T)& theObj, const char* const theKey ); 00043 static BdbStatus put( BdbRef(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj ); 00044 static BdbStatus put( BdbRef(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj, const char* const theKey ); 00045 static BdbStatus put( BdbHandle(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj ); 00046 static BdbStatus put( BdbHandle(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj, const char* const theKey ); 00047 00048 }; 00049 00050 template <class T> 00051 BdbRef(T) 00052 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr ) { 00053 ooTypeNumber theType = ooTypeN(T); 00054 BdbRef(BdbPersObj) item( 0 ); 00055 BdbStatus status = theHdr->get( item, theType, 0 ); 00056 return (BdbRef(T)&)item; 00057 } 00058 00059 template <class T> 00060 BdbRef(T) 00061 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr, const char* const theKey ) { 00062 ooTypeNumber theType = ooTypeN(T); 00063 BdbRef(BdbPersObj) item( 0 ); 00064 BdbStatus status = theHdr->get( item, theType, theKey ); 00065 return (BdbRef(T)&)item; 00066 } 00067 00068 template <class T> 00069 BdbStatus 00070 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr, BdbRef(T)& theObj ) { 00071 ooTypeNumber theType = ooTypeN(T); 00072 BdbStatus result = theHdr->get( theObj, theType, 0 ); 00073 return result; 00074 } 00075 00076 template <class T> 00077 BdbStatus 00078 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr, BdbRef(T)& theObj, const char* const theKey ) { 00079 ooTypeNumber theType = ooTypeN(T); 00080 BdbStatus result = theHdr->get( theObj, theType, theKey ); 00081 return result; 00082 } 00083 00084 template <class T> 00085 BdbStatus 00086 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr, BdbHandle(T)& theObj ) { 00087 BdbRef( T ) ref ; 00088 BdbStatus result = BdbHdrAccessP<T>::get( theHdr , ref ) ; 00089 theObj = ref ; 00090 return result; 00091 } 00092 00093 template <class T> 00094 BdbStatus 00095 BdbHdrAccessP<T>::get( const BdbRef(BdbGenericHdrP)& theHdr, BdbHandle(T)& theObj, const char* const theKey ) { 00096 BdbRef( T ) ref ; 00097 BdbStatus result = BdbHdrAccessP<T>::get( theHdr , ref , theKey ) ; 00098 theObj = ref ; 00099 return result; 00100 } 00101 00102 template <class T> 00103 BdbStatus 00104 BdbHdrAccessP<T>::put( BdbRef(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj ) { 00105 BdbRef(BdbPersObj) anObj = theObj; 00106 BdbStatus result = theHdr->put( anObj, 0 ); 00107 return result; 00108 } 00109 00110 template <class T> 00111 BdbStatus 00112 BdbHdrAccessP<T>::put( BdbRef(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj, const char* const theKey ) { 00113 BdbRef(BdbPersObj) anObj = theObj; 00114 BdbStatus result = theHdr->put( anObj, theKey ); 00115 return result; 00116 } 00117 00118 template <class T> 00119 BdbStatus 00120 BdbHdrAccessP<T>::put( BdbHandle(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj ) { 00121 BdbRef(BdbPersObj) anObj = theObj; 00122 BdbStatus result = theHdr->put( anObj, 0 ); 00123 return result; 00124 } 00125 00126 template <class T> 00127 BdbStatus 00128 BdbHdrAccessP<T>::put( BdbHandle(BdbGenericHdrP)& theHdr, const BdbRef(T)& theObj, const char* const theKey ) { 00129 BdbRef(BdbPersObj) anObj = theObj; 00130 BdbStatus result = theHdr->put( anObj, theKey ); 00131 return result; 00132 } 00133 00134 #endif /* BDBHDRACCESSP_HH */
BaBar Public Site | SLAC | News | Links | Who's Who | Contact Us
Page Owner: Jacek Becla
Last Update: October 04, 2002