library: libCore #include "TExMap.h"

# TExMap

class description - source file - inheritance tree (.pdf)

## class TExMap : public TObject

| Inheritance Chart:
`TObject`
| <- | `TExMap` |

        private:

            void Expand(Int_t newsize)
           Int_t FindElement(ULong_t hash, Long_t key)
            void FixCollisions(Int_t index)
          Bool_t HighWaterMark()

        public:

                          TExMap(Int_t mapSize = 100)
                          TExMap(const TExMap& map)
                          ~TExMap()
                     void Add(ULong_t hash, Long_t key, Long_t value)
                     void Add(Long_t key, Long_t value)
                    Int_t Capacity() const
           static TClass* Class()
             virtual void Delete(Option_t* opt = "")
                    Int_t GetSize() const
                   Long_t GetValue(ULong_t hash, Long_t key)
                   Long_t GetValue(Long_t key)
          virtual TClass* IsA() const
                  Long_t& operator()(ULong_t hash, Long_t key)
                  Long_t& operator()(Long_t key)
                  TExMap& operator=(const TExMap&)
                     void Remove(ULong_t hash, Long_t key)
                     void Remove(Long_t key)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          TExMap::Assoc_t* fTable
                     Int_t fSize
                     Int_t fTally

## Class Description

     TExMap

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

TExMap(Int_t mapSize)

     Create a TExMap.

TExMap(const TExMap &map) : TObject(map)

     Copy constructor.

~TExMap()

     Delete TExMap.

void Add(ULong_t hash, Long_t key, Long_t value)

     Add an (key,value) pair to the table. The key should be unique.

void Delete(Option_t *)

     Delete all entries stored in the TExMap.

Long_t GetValue(ULong_t hash, Long_t key)

     Return the value belonging to specified key and hash value. If key not
     found return 0.

void Remove(ULong_t hash, Long_t key)

     Remove entry with specified key from the TExMap.

Int_t FindElement(ULong_t hash, Long_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.

### Inline Functions

                 Bool_t HighWaterMark()
                   void Add(Long_t key, Long_t value)
                  Int_t Capacity() const
                  Int_t GetSize() const
                 Long_t GetValue(Long_t key)
                   void Remove(Long_t key)
                Long_t& operator()(ULong_t hash, Long_t key)
                Long_t& operator()(Long_t key)
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void StreamerNVirtual(TBuffer& b)
                TExMap& operator=(const TExMap&)

Author: Fons Rademakers 26/05/99
Last update: root/cont:$Name: $:$Id: TExMap.cxx,v 1.8 2005/02/01 14:43:57 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *