|
BrEventNodeclass description - source file - inheritance tree class BrEventNode : public BrDataObjectprivate: Data Membersprivate: See alsoClass DescriptionBrEventNode is a BRAHMS data class providing storage and access function for event data information. The data is stored in BrDataObject objects that are kept inside a THashList (currently a TObjArray). This allows modification of the BrEvent content by the user, with the BrDataObject providing a standard interface for information retrieval, bookkeeping and I/O selection. Note that the node own its contained objects. That is, when the node is deleted via a operator delete, the objects contained in the class is deleted too, and you can no longer refence that memory. See also BrEventNode::~BrEventNode and chapter 8 in [1]. A consideration on owner ship (Christian Holm): ----------------------------------------------- Since the node owns it's refenerenced (or contained) objects, it's impossible for a BrModule to have a cache of memory to be reused in the event loop. This is a rather unfortunate sideeffect. What we'd like to allow for modules to do, is to create a TClonesArray and use that as a memory pool: In BrModule::Init: fPool = new TClonesArray("BrSomeDataClass"); This pool will then be used in the event loop, and references into that pool will be put in the node: In BrModule::Event(inNode, outNode): fPool->Clear(); ... BrSomeDataClass* data = new((*fPool)[fNData++]) BrSomeDataClass(); outNode->AddObject(data); If a module does not want to pool the memory (?), then it must explicitly set the kCanDelete bit: In BrModule::Event(inNode, outNode): BrSomeDataClass* data = new BrSomeDataClass(); data->SetBit(kCanDelete, kTRUE); outNode->AddObject(data); Ofcourse the data class could per default set that bit. This strategy could significantly speed up the BRAT code, since the ::operator new and ::operator delete messages are very expensive indeed, which can be circumvented by using a pool of data. The strategy outlined of course requires that BrSomeDataClass is of fixed size, that is does not allocate memory, and pointers should be non-persistant (requirement of TClonesArray). Since using this strategy has far reaching effects on the code, it will not be implmented at this time (Mon Aug 20 16:15:13 2001), but _must_ await a consensues decision. Side note: ---------- Note the use ofHashTables. This will be most efficient to access data by name. This should be chekced out carefully, and performence measured. Note this is in fact not the case simple TObjArrays are used. /* References: BrEventNode() Constructor. Set counter and list data members to zero. Don't use this constructor unless you have to and know what you are doing Use BrEventNode(Char_t Name) instead BrEventNode(const Char_t* Name, const Char_t *Title ) : BrDataObject(Name,Title) Constructor. Create the hash table for storing the data objects for this event. Set the eventnode name BrEventNode(const BrEventNode &node) Copy constructor. This is done in a simple way for now. and this will NOT work as defined!!!! ~BrEventNode() Destructor. Delete BrEventNode and all the data objects currently owned by BrEventNode. It is assumed but not checked that all member in the lower nodes are also deleted. void CheckList() Check if list exist. If not, create it. Int_t AddObject(BrDataObject *object) Add a BrDataObejct to the EventNode. The object can be simple, or an EventNode.. BrEventNode* GetEventNode(const Char_t *name) const Return the node named name BrDataTable* GetDataTable(const Char_t *name) const Get a pointer to a BrDataObject with the given Name in the node or lower in the tree. Only the first occurence of an object with a specified name is returned. Recursive calls are made if EventNodes are part of the list. BrDataObject* GetObject(const Char_t *name) const Get a pointer to a BrDataObject with the given Name in the node or lower in the tree. Only the first occurence of an object with a specified name is returned. Recursive calls are made if EventNodes are part of the list. void Clear(Option_t* option) Clear internal TObjArray object. That is, remove pointers to actual objects. The objects are only deleted (memory freed) if the TObjArray::SetOwner(kTRUE) message has been sent, or the kCanDelete bit is set (see also the class description). void ListObjects() const List on standard out a summary of BrDataObjects in the EventNode. The listing is recursive. All levels are scanned. Depreciated. Use Print instead. void Copy(BrEventNode &eventnode) Copy contents from this into eventnode void RemoveDataObject(BrDataObject* object) Remove Dataobject from Table, but do not delete obejct. void Browse(TBrowser* b) void Print(Option_t* option) const Print all contained objects, passing the option along. Options: R Recursive print [Default] See also BrDataObject::Print void Streamer(TBuffer &R__b) Stream an object of class BrEvent. Inline FunctionsInt_t AddDataTable(BrDataTable* table) Int_t AddEventNode(BrEventNode* node) TObjArray* GetObjectList() const Bool_t IsNode() const Bool_t IsFolder() const void SetOwner(Bool_t e = kTRUE) void SetVerbose(Int_t i) BrEventNode& operator+=(const BrEventNode&) BrEventNode& operator=(const BrEventNode& rhs) BrEventNode& operator=(const BrEvent& rhs) TClass* Class() TClass* IsA() const void ShowMembers(TMemberInspector& insp, char* parent) void StreamerNVirtual(TBuffer& b) |
||||||
This page automatically generated by script docBrat by Christian Holm |
Copyright ; 2002 BRAHMS Collaboration
<brahmlib@rcf.rhic.bnl.gov>
|