ROOT logo
ROOT » CORE » CONT » TExMap

class TExMap: public TObject


TExMap

This class stores a (key,value) pair using an external hash.
The (key,value) are Long64_t's and therefore can contain object
pointers or any longs. The map uses an open addressing hashing
method (linear probing).


Function Members (Methods)

public:
TExMap(Int_t mapSize = 100)
TExMap(const TExMap& map)
virtual~TExMap()
voidTObject::AbstractMethod(const char* method) const
voidAdd(Long64_t key, Long64_t value)
voidAdd(ULong64_t hash, Long64_t key, Long64_t value)
voidAddAt(UInt_t slot, ULong64_t hash, Long64_t key, Long64_t value)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
Int_tCapacity() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidDelete(Option_t* opt = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetSize() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
Long64_tGetValue(Long64_t key)
Long64_tGetValue(ULong64_t hash, Long64_t key)
Long64_tGetValue(ULong64_t hash, Long64_t key, UInt_t& slot)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
Long64_t&operator()(Long64_t key)
Long64_t&operator()(ULong64_t hash, Long64_t key)
TExMap&operator=(const TExMap&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidRemove(Long64_t key)
voidRemove(ULong64_t hash, Long64_t key)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidExpand(Int_t newsize)
Int_tFindElement(ULong64_t hash, Long64_t key)
voidFixCollisions(Int_t index)
Bool_tHighWaterMark()

Data Members

private:
Int_tfSize
TExMap::Assoc_t*fTable
Int_tfTally

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TExMap(Int_t mapSize)
 Create a TExMap.
TExMap(const TExMap &map)
 Copy constructor.
TExMap& operator=(const TExMap& )
 Assignement operator.
~TExMap()
void Add(ULong64_t hash, Long64_t key, Long64_t value)
 Add an (key,value) pair to the table. The key should be unique.
void AddAt(UInt_t slot, ULong64_t hash, Long64_t key, Long64_t value)
 Add an (key,value) pair to the table. The key should be unique.
 If the 'slot' is open, use it to store the value,
 otherwise revert to Add(hash,key,value)
 This is usually used in conjuction with GetValue wiht 3 parameters:
 if ((idx = (ULong64_t)fMap->GetValue(hash, key, slot)) != 0) {

 } else {
    fMap->AddAt(slot,hash,key,value);
 }
Long64_t & operator()(ULong64_t hash, Long64_t key)
 Return a reference to the value belonging to the key with the
 specified hash value. If the key does not exist it will be added.
 NOTE: the reference will be invalidated an Expand() triggered by
 an Add() or another operator() call.
void Delete(Option_t* opt = "")
 Delete all entries stored in the TExMap.
Long64_t GetValue(ULong64_t hash, Long64_t key)
 Return the value belonging to specified key and hash value. If key not
 found return 0.
Long64_t GetValue(ULong64_t hash, Long64_t key, UInt_t& slot)
 Return the value belonging to specified key and hash value. If key not
 found return 0.
 In 'slot', return the index of the slot used or the first empty slot.
 (to be used with AddAt).
void Remove(ULong64_t hash, Long64_t key)
 Remove entry with specified key from the TExMap.
Int_t FindElement(ULong64_t hash, Long64_t key)
 Find an entry with specified hash and key in the TExMap.
 Returns the slot of the key or the next empty slot.
void FixCollisions(Int_t index)
 Rehash the map in case an entry has been removed.
void Expand(Int_t newsize)
 Expand the TExMap.
void Streamer(TBuffer& b)
 Stream all objects in the collection to or from the I/O buffer.
Bool_t HighWaterMark()
{ return (Bool_t) (fTally >= ((3*fSize)/4)); }
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Int_t Capacity() const
{ return fSize; }
Int_t GetSize() const
{ return fTally; }
Long64_t GetValue(ULong64_t hash, Long64_t key)
void Remove(ULong64_t hash, Long64_t key)
Long64_t & operator()(ULong64_t hash, Long64_t key)