#include <RecRecordImp.h>
Inheritance diagram for RecRecordImp< T >:

Public Member Functions | |
| RecRecordImp () | |
| RecRecordImp (const T &header) | |
| virtual | ~RecRecordImp () |
| virtual const T & | GetHeader () const |
| virtual Registry & | GetTempTags () |
| virtual const Registry & | GetTempTags () const |
| virtual const VldContext * | GetVldContext () const |
| virtual bool | IsPersistedToOutputStream (const char *stream="", const char *file="", const char *tree="", int index=-1) const |
| virtual bool | IsClearable () const |
| virtual bool | IsPerOwned () const |
| virtual bool | IsTransient () const |
| virtual const RecJobHistory & | GetJobHistory () const |
| virtual std::ostream & | Print (std::ostream &os) const |
| virtual void | Print (Option_t *option="") const |
| virtual void | HasBeenModified () |
| virtual void | PersistedToOutputStream (const char *stream, const char *file, const char *tree, int index) |
| virtual void | SetClearable (bool isClearable=true) |
| virtual void | SetTransient (bool isTransient=true) |
| virtual void | SetPerOwned (bool isPerOwned=false) |
Private Attributes | |
| T | fHeader |
| Bool_t | fIsClearable |
| RecJobHistory | fJobHistory |
| Registry | fTempTags |
|
|||||||||
|
Definition at line 23 of file RecRecordImp.h. 00023 : fHeader(),fIsClearable(false),fTempTags() {}
|
|
||||||||||
|
Definition at line 25 of file RecRecordImp.h. 00025 : fHeader(header),fIsClearable(false), 00026 fTempTags() {} // normal constructor
|
|
|||||||||
|
Definition at line 27 of file RecRecordImp.h. 00027 {}
|
|
|||||||||
|
|||||||||
|
Definition at line 39 of file RecRecordImp.h. Referenced by RerootToTruthModule::Get(), PhotonTransport::Get(), NtpStModule::Get(), DetSim::Get(), PTSimModule::Reco(), NtpTHModule::Reco(), NtpSRModule::Reco(), and NtpMCModule::Reco(). 00039 { return fJobHistory; }
|
|
|||||||||
|
Implements RecRecord. Definition at line 32 of file RecRecordImp.h. 00032 { return fTempTags; }
|
|
|||||||||
|
Implements RecRecord. Definition at line 31 of file RecRecordImp.h. Referenced by ToyMCModule::Get(), RerootToTruthModule::Get(), RerootFlsDigitToDigiPE::Get(), PhotonInjector::Get(), MCMerge::Get(), LightInjector::Get(), CustomLightInjector::Get(), and MCMerge::GrabStreamEvents(). 00031 { return fTempTags; }
|
|
|||||||||
|
|||||||||
|
Implements RecRecord. Definition at line 43 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, and Registry::RemoveKey(). Referenced by AlgFactory::GetOwnedConfigRecord(). 00043 {
00044 //
00045 // Purpose: Handle generic record tasks appropriate for when record
00046 // has been newly modified.
00047 //
00048 // Arguments: none.
00049 //
00050 // Return: none.
00051 //
00052 // Contact: S. Kasahara
00053 //
00054 // Notes: The default behavior provided by this method is to clear
00055 // the Registry value associated with the key "outstream" in
00056 // the Registry fTempTags data member. This indicates to
00057 // any output module(s) in the user's job path(s) that the modified
00058 // record should be re-persisted.
00059 //
00060
00061 fTempTags.RemoveKey("outstream");
00062 return;
00063
00064 }
|
|
|||||||||
|
Implements RecRecord. Definition at line 36 of file RecRecordImp.h. 00036 { return fIsClearable; }
|
|
|||||||||
|
Implements RecRecord. Definition at line 193 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, and Registry::Get(). 00193 {
00194 //
00195 // Purpose: If IsPerOwned (def=false), record is owned by Persistency
00196 // Mom should only Remove the record from its array of
00197 // fragments, but not delete it.
00198 //
00199 // Arguments: none.
00200 //
00201 // Return: true or false.
00202 //
00203 // Contact: S. Kasahara
00204 //
00205
00206 int isPerOwned = 0;
00207 if ( !fTempTags.Get("isPerOwned",isPerOwned) ) return false;
00208 return ( isPerOwned ) ? true : false;
00209
00210 }
|
|
||||||||||||||||||||||||
|
Implements RecRecord. Definition at line 130 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, Registry::Get(), and s(). Referenced by RecValidate::TestRecordTempTags(). 00131 {
00132 //
00133 // Purpose: Check to see if record has been persisted to the output
00134 // stream/file/tree/tree index of interest.
00135 //
00136 // Arguments: stream/tree/file/tree index of interest. If a value is
00137 // left at default ("" for stream/tree/file, or -1 for index),
00138 // that argument will not be checked.
00139 //
00140 // Return: true or false. Result will be true if all non-default arguments
00141 // match those of one of the output streams to which this record
00142 // has been persisted.
00143 //
00144 // Contact: S. Kasahara
00145 //
00146
00147 std::string s(stream);
00148 std::string f(file);
00149 std::string t(tree);
00150
00151 Registry outStreamRegistry;
00152 int nout = 0;
00153 if ( fTempTags.Get("outstream",outStreamRegistry) ) {
00154 outStreamRegistry.Get("nout",nout);
00155 for ( int iout = 0; iout < nout; iout++) {
00156 char cioutkey[20];
00157 sprintf(cioutkey,"%i",iout);
00158 Registry outStream;
00159 outStreamRegistry.Get(cioutkey,outStream);
00160 bool isMatch = true;
00161 if ( !s.empty() ) {
00162 const char* cstream = 0;
00163 outStream.Get("stream",cstream);
00164 if ( std::string(cstream) != s ) isMatch = false;
00165 }
00166 if ( !f.empty() ) {
00167 const char* cfile = 0;
00168 outStream.Get("file",cfile);
00169 if ( std::string(cfile) != f ) isMatch = false;
00170 }
00171
00172 if ( !t.empty() ) {
00173 const char* ctree = 0;
00174 outStream.Get("tree",ctree);
00175 if ( std::string(ctree) != t ) isMatch = false;
00176 }
00177 if ( index > -1 ) {
00178 int storedindex = -1;
00179 outStream.Get("index",storedindex);
00180 if ( storedindex != index ) isMatch = false;
00181 }
00182 if ( isMatch ) {
00183 return true; // found match in registry
00184 }
00185 }
00186 }
00187
00188 return false; // failed to find match in registry
00189
00190 }
|
|
|||||||||
|
Implements RecRecord. Definition at line 213 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, and Registry::Get(). Referenced by RecValidate::TestRecordTempTags(). 00213 {
00214 //
00215 // Purpose: If IsTransient (def=true), record will exist in memory for one
00216 // job cycle only.
00217 //
00218 // Arguments: none.
00219 //
00220 // Return: true or false.
00221 //
00222 // Contact: S. Kasahara
00223 //
00224
00225 int isTransient = 1;
00226 if ( !fTempTags.Get("isTransient",isTransient) ) return true;
00227 return ( isTransient ) ? true : false;
00228
00229 }
|
|
||||||||||||||||||||||||
|
Implements RecRecord. Definition at line 67 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, Registry::Get(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues(). 00068 {
00069 //
00070 // Purpose: Mark the record as having been stored in the named stream,file,
00071 // tree, tree index location.
00072 //
00073 // Arguments: stream name, file name, tree name, tree index to which record
00074 // was stored.
00075 //
00076 // Return: none.
00077 //
00078 // Contact: S. Kasahara
00079 //
00080 // Notes: The output stream,file,tree,treeindex will be stored in
00081 // Registry fTempTags in the following manner:
00082 // key type/value
00083 // === ==========
00084 // "outstream" Registry/see below:
00085 // key type/value
00086 // === ==========
00087 // "nout" int/# times this record has been persisted
00088 // "0" Registry/see below:
00089 // "1" Registry/ "
00090 // ... Registry/ "
00091 // "nout-1" Registry/ "
00092 // key type/value
00093 // === ==========
00094 // "stream" const char*/output stream name
00095 // "file" const char*/output file name
00096 // "tree" const char*/output tree name
00097 // "index" int /output tree index
00098 //
00099
00100 Registry outStreamRegistry;
00101 int nout = 0;
00102 if ( fTempTags.Get("outstream",outStreamRegistry) ) {
00103 outStreamRegistry.Get("nout",nout);
00104 }
00105 outStreamRegistry.UnLockValues();
00106
00107 // New output stream registry
00108 Registry newOutStream;
00109 newOutStream.Set("stream",stream);
00110 newOutStream.Set("file",file);
00111 newOutStream.Set("tree",tree);
00112 newOutStream.Set("index",index);
00113
00114 // Insert new output stream registry at key nout of "outstream" registry
00115 char cnoutkey[20];
00116 sprintf(cnoutkey,"%i",nout);
00117 outStreamRegistry.Set(cnoutkey,newOutStream);
00118 nout++;
00119 outStreamRegistry.Set("nout",nout);
00120 outStreamRegistry.LockValues();
00121
00122 // Store revised "outstream" registry
00123 fTempTags.UnLockValues();
00124 fTempTags.Set("outstream",outStreamRegistry);
00125 fTempTags.LockValues();
00126
00127 }
|
|
||||||||||
|
Implements RecRecord. Reimplemented in VHSevent, UberRecord, UberRecordLite, NtpEMRecord, NtpSRRecord, NtpMRRecord, NtpCandRecord, RecDataRecord< T >, NtpStRecord, RecDataRecord< RecHeader >, and RecDataRecord< SimSnarlHeader >. Definition at line 293 of file RecRecordImp.cxx. References RecRecordImp< T >::Print(). 00293 {
00294 //
00295 // Purpose: Print header in form supported by TObject::Print.
00296 //
00297 // Arguments: option (not used)
00298 //
00299 // Return: none.
00300 //
00301 // Contact: S. Kasahara
00302 //
00303
00304 Print(std::cout);
00305
00306 return;
00307
00308 }
|
|
||||||||||
|
||||||||||
|
Definition at line 48 of file RecRecordImp.h. 00049 { fIsClearable = isClearable; }
|
|
||||||||||
|
Implements RecRecord. Definition at line 253 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, Registry::LockValues(), Registry::Set(), and Registry::UnLockValues(). 00253 {
00254 //
00255 // Purpose: Set ownership status of record. If set true(def), record is
00256 // owned by Persistency and the user should not delete.
00257 //
00258 // Arguments: true or false.
00259 //
00260 // Return: none.
00261 //
00262 // Contact: S. Kasahara
00263 //
00264
00265 fTempTags.UnLockValues();
00266 if ( isPerOwned ) fTempTags.Set("isPerOwned",1);
00267 else fTempTags.Set("isPerOwned",0);
00268 fTempTags.LockValues();
00269 return;
00270
00271 }
|
|
||||||||||
|
Implements RecRecord. Definition at line 232 of file RecRecordImp.cxx. References RecRecordImp< T >::fTempTags, Registry::LockValues(), Registry::Set(), and Registry::UnLockValues(). Referenced by AlgFactory::GetOwnedConfigRecord(). 00232 {
00233 //
00234 // Purpose: Set transient state of record. If set true(def), record will
00235 // exist in memory for one job cycle only.
00236 //
00237 // Arguments: true or false.
00238 //
00239 // Return: none.
00240 //
00241 // Contact: S. Kasahara
00242 //
00243
00244 fTempTags.UnLockValues();
00245 if ( isTransient ) fTempTags.Set("isTransient",1);
00246 else fTempTags.Set("isTransient",0);
00247 fTempTags.LockValues();
00248 return;
00249
00250 }
|
|
|||||
|
Definition at line 55 of file RecRecordImp.h. Referenced by RecRecordImp< T >::Print(). |
|
|||||
|
Definition at line 56 of file RecRecordImp.h. |
|
|||||
|
Definition at line 57 of file RecRecordImp.h. Referenced by RecRecordImp< T >::Print(). |
|
|||||
1.3.9.1