KaliVeda
Toolkit for HIC analysis
KVList Class Reference

Detailed Description

Extended TList class which owns its objects by default.

This is an extended version of the ROOT TList class, with all of the extensions defined in KVSeqCollection. The specificity of KVList is that it owns it objects by default: any objects placed in a KVList will be deleted when the KVList is deleted, goes out of scope, or if methods Clear() or Delete() are called.

To avoid this, either use the argument to the constructor:

KVList list_not_owner(kFALSE); //list does not own its objects
Extended TList class which owns its objects by default.
Definition: KVList.h:28

or use the method SetOwner() to change the ownership after object creation.

Sorting the list

As TList::Sort() is defined, we implemented a KVList::Sort() method which takes exactly the same argument as TList::Sort().

Examples
KVClassFactory_examples.C.

Definition at line 28 of file KVList.h.

#include <KVList.h>

Inheritance diagram for KVList:

Public Member Functions

 KVList (Bool_t owner=kTRUE)
 
virtual ~ KVList ()
 
void Sort (Bool_t order=kSortAscending)
 
- Public Member Functions inherited from KVSeqCollection
 KVSeqCollection ()
 Default constructor. More...
 
 KVSeqCollection (const Char_t *collection_classname)
 
 KVSeqCollection (const KVSeqCollection &)
 
virtual ~KVSeqCollection ()
 
virtual void Add (TObject *obj)
 
virtual void AddAfter (const TObject *after, TObject *obj)
 
virtual void AddAt (TObject *obj, Int_t idx)
 
virtual void AddBefore (const TObject *before, TObject *obj)
 
virtual void AddFirst (TObject *obj)
 
virtual void AddLast (TObject *obj)
 
virtual TObject * After (const TObject *obj) const
 
virtual TObject * At (Int_t idx) const
 
virtual TObject * Before (const TObject *obj) const
 
virtual void Clear (Option_t *option="")
 
const Char_t * CollectionClassName () const
 
virtual void Copy (TObject &obj) const
 
virtual void Delete (Option_t *option="")
 
virtual void Execute (const char *method, const char *params, Int_t *error=0)
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=0)
 
virtual TObject * FindObject (const char *name) const
 
virtual TObject * FindObject (const TObject *obj) const
 
virtual TObject * FindObjectAny (const Char_t *att, const Char_t *keys, Bool_t contains_all=kFALSE, Bool_t case_sensitive=kTRUE) const
 
TObject * FindObjectByClass (const Char_t *) const
 Return (first) object in embedded list with given class. More...
 
TObject * FindObjectByClass (const TClass *) const
 Return (first) object in embedded list with given class. More...
 
virtual TObject * FindObjectByLabel (const Char_t *) const
 
virtual TObject * FindObjectByName (const Char_t *name) const
 
virtual TObject * FindObjectByNumber (UInt_t num) const
 
virtual TObject * FindObjectByTitle (const Char_t *) const
 Will return object with given title (value of TObject::GetTitle() method). More...
 
virtual TObject * FindObjectByType (const Char_t *) const
 
virtual TObject * FindObjectWithMethod (const Char_t *retvalue, const Char_t *method) const
 
virtual TObject * FindObjectWithNameAndType (const Char_t *name, const Char_t *type) const
 
virtual TObject * First () const
 
template<typename T >
T * get_object (const TString &name) const
 
TSeqCollection * GetCollection () const
 
virtual TObject ** GetObjectRef (const TObject *obj) const
 Return reference to object. More...
 
virtual Int_t GetSize () const
 
KVSeqCollectionGetSubListWithClass (const Char_t *class_name) const
 
KVSeqCollectionGetSubListWithClass (const TClass *_class) const
 
KVSeqCollectionGetSubListWithLabel (const Char_t *retvalue) const
 
KVSeqCollectionGetSubListWithMethod (const Char_t *retvalue, const Char_t *method) const
 
KVSeqCollectionGetSubListWithName (const Char_t *retvalue) const
 
KVSeqCollectionGetSubListWithType (const Char_t *retvalue) const
 
virtual Bool_t IsCleanup () const
 
virtual Bool_t IsSendingModifiedSignals () const
 
virtual Bool_t IsSortable () const
 
virtual Bool_t IsSorted () const
 
virtual TObject * Last () const
 
virtual TIterator * MakeIterator (Bool_t dir=kIterForward) const
 Make and return iterator for the list. More...
 
virtual void Modified ()
 
KVSeqCollectionoperator= (const KVSeqCollection &)
 
virtual void RecursiveRemove (TObject *obj)
 
virtual TObject * Remove (TObject *obj)
 Remove object from list. More...
 
virtual void SendModifiedSignals (Bool_t yes=kTRUE)
 
virtual void SetCleanup (Bool_t enable=kTRUE)
 
virtual void SetOwner (Bool_t enable=kTRUE)
 

Additional Inherited Members

- Static Public Member Functions inherited from KVSeqCollection
static KVSeqCollectionMakeListFromFile (TFile *file)
 
static KVSeqCollectionMakeListFromFileWithClass (TFile *file, const Char_t *class_name)
 
static KVSeqCollectionMakeListFromFileWithClass (TFile *file, const TClass *_class)
 
static KVSeqCollectionMakeListFromFileWithMethod (TFile *file, const Char_t *retvalue, const Char_t *method)
 
static void RehashCleanupList ()
 

Constructor & Destructor Documentation

◆ KVList()

KVList::KVList ( Bool_t  owner = kTRUE)

Default ctor. By default, a KVList owns its objects.

Definition at line 10 of file KVList.cpp.

◆ ~ KVList()

virtual KVList::~ KVList ( )
inlinevirtual

Definition at line 33 of file KVList.h.

Member Function Documentation

◆ Sort()

void KVList::Sort ( Bool_t  order = kSortAscending)
inline

Definition at line 35 of file KVList.h.