#include <ConfigRecord.h>
Inheritance diagram for ConfigRecord:

Public Member Functions | |
| ConfigRecord () | |
| ConfigRecord (const RecHeader &header) | |
| virtual | ~ConfigRecord () |
| Bool_t | AreConfigsOwned () const |
| TIter | GetConfigIter (Bool_t dir=kIterForward) |
| void | SecureConfig (AlgConfig &ac) |
Protected Attributes | |
| Bool_t | fOwnsConfigs |
Definition at line 20 of file ConfigRecord.h.
| ConfigRecord::ConfigRecord | ( | ) |
Definition at line 21 of file ConfigRecord.cxx.
00021 : 00022 RecDataRecord<RecHeader>() 00023 , fOwnsConfigs(kTRUE) // ConfigRecord owns AlgConfigs when read-in 00024 { 00025 // Config ownership must be false in writing job and true in reading job 00026 // So use fOwnsConfigs(kTRUE) instead of TObjArray::SetOwner(kTRUE). 00027 }
| ConfigRecord::ConfigRecord | ( | const RecHeader & | header | ) |
Definition at line 30 of file ConfigRecord.cxx.
00030 : 00031 RecDataRecord<RecHeader>(header) 00032 , fOwnsConfigs(kFALSE) // AlgFactory owns AlgConfigs in writing job 00033 { 00034 // Config ownership must be false in writing job and true in reading job 00035 // So use fOwnsConfigs(kFALSE) instead of TObjArray::SetOwner(kFALSE). 00036 }
| ConfigRecord::~ConfigRecord | ( | ) | [virtual] |
Definition at line 39 of file ConfigRecord.cxx.
References fOwnsConfigs, and RecDataRecord< RecHeader >::GetComponents().
00040 { 00041 00042 // TObjArray::Delete() crashes even when TObjArray is "non-owned" (bug?) 00043 // So use TObjArray::RemoveAll() before ~RecDataRecord invokes Delete(). 00044 00045 // Config ownership must be false in writing job and true in reading job 00046 // So test "fOwnsConfigs==kFALSE", not "TObjArray::IsOwner()==kFALSE" 00047 00048 // RecDataRecord::fComponents should be "protected:" to avoid const_cast 00049 TObjArray &toa = (const_cast <TObjArray &> (GetComponents())); 00050 if (fOwnsConfigs == kFALSE) { 00051 toa.SetOwner(kFALSE); // Limits damage from ~RecDataRecord's Delete 00052 toa.RemoveAll(); 00053 } 00054 }
| Bool_t ConfigRecord::AreConfigsOwned | ( | ) | const [inline] |
| TIter ConfigRecord::GetConfigIter | ( | Bool_t | dir = kIterForward |
) |
Definition at line 57 of file ConfigRecord.cxx.
References RecDataRecord< RecHeader >::GetComponents().
Referenced by RecordSetupModule::Reco().
00058 { 00059 return TIter(&GetComponents(), dir); 00060 }
| void ConfigRecord::SecureConfig | ( | AlgConfig & | ac | ) |
Definition at line 64 of file ConfigRecord.cxx.
References RecDataRecord< RecHeader >::AdoptComponent().
Referenced by AlgFactory::GetOwnedConfigRecord().
00065 { 00066 00067 // Secure an AlgConfig object. It saves a non-owned AlgConfig pointer. 00068 AdoptComponent(&ac); 00069 }
Bool_t ConfigRecord::fOwnsConfigs [protected] |
1.4.7