library: libCore #include "TClassTable.h"

# TClassTable

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

## class TClassTable : public TObject

| Inheritance Chart:

`TObject`

<-

`TClassTable`

        private:

                             TClassTable()
          static ClassRec_t* FindElement(const char* cname, Bool_t insert = kFALSE)
                 static void SortTable()

        public:

                               TClassTable(const TClassTable&)
                               ~TClassTable()
                   static void Add(const char* cname, Version_t id, const type_info& info, VoidFuncPtr_t dict, Int_t pragmabits)
                static TClass* Class()
                           int Classes()
          static VoidFuncPtr_t GetDict(const char* cname)
          static VoidFuncPtr_t GetDict(const type_info& info)
              static Version_t GetID(const char* cname)
                  static Int_t GetPragmaBits(const char* name)
                   static void Init()
               virtual TClass* IsA() const
                  static char* Next()
                  TClassTable& operator=(const TClassTable&)
                  virtual void Print(Option_t* option) const
                   static void PrintTable()
                   static void Remove(const char* cname)
                  virtual void ShowMembers(TMemberInspector& insp, char* parent)
                  virtual void Streamer(TBuffer& b)
                          void StreamerNVirtual(TBuffer& b)
                   static void Terminate()

### Data Members

        private:

                       static ClassRec_t** fgTable
                       static ClassRec_t** fgSortedTable
          static ROOT::TMapTypeToClassRec* fgIdMap
                                static int fgSize
                                static int fgTally
                             static Bool_t fgSorted
                                static int fgCursor

        public:

          static const enum TClassTable:: kNoStreamer
          static const enum TClassTable:: kNoInputOperator
          static const enum TClassTable:: kAutoStreamer

## Class Description

     This class registers for all classes their name, id and dictionary
     function in a hash table. Classes are automatically added by the
     ctor of a special init class when a global of this init class is
     initialized when the program starts (see the ClassImp macro).

TClassTable()

     TClassTable is a singleton (i.e. only one can exist per application).

~TClassTable()

     TClassTable singleton is deleted in Terminate().

void Print(Option_t *option) const

     Print the class table. Before printing the table is sorted
     alphabetically. Only classes specified in option are listed.
     The default is to list all classes.
     Standard wilcarding notation supported.

int Classes()

    ______________________________________________________________________________

void Init()

void Add(const char *cname, Version_t id, const type_info &info, VoidFuncPtr_t dict, Int_t pragmabits)

     Add a class to the class table (this is a static function).

void Remove(const char *cname)

     Remove a class from the class table. This happens when a shared library
     is unloaded (i.e. the dtor's of the global init objects are called).

ClassRec_t* FindElement(const char *cname, Bool_t insert)

     Find a class by name in the class table (using hash of name). Returns
     0 if the class is not in the table. Unless arguments insert is true in
     which case a new entry is created and returned.

Version_t GetID(const char *cname)

     Returns the ID of a class.

Int_t GetPragmaBits(const char *cname)

     Returns the pragma bits as specified in the LinkDef.h file.

VoidFuncPtr_t GetDict(const char *cname)

     Given the class name returns the Dictionary() function of a class
     (uses hash of name).

VoidFuncPtr_t GetDict(const type_info& info)

     Given the type_info returns the Dictionary() function of a class
     (uses hash of type_info::name()).

char* Next()

     Returns next class from sorted class table.

void PrintTable()

     Print the class table. Before printing the table is sorted
     alphabetically.

void SortTable()

     Sort the class table by ascending class ID's.

void Terminate()

     Deletes the class table (this static class function calls the dtor).

### Inline Functions

                 TClass* Class()
                 TClass* IsA() const
                    void ShowMembers(TMemberInspector& insp, char* parent)
                    void Streamer(TBuffer& b)
                    void StreamerNVirtual(TBuffer& b)
             TClassTable TClassTable(const TClassTable&)
            TClassTable& operator=(const TClassTable&)

Author: Fons Rademakers 11/08/95
Last update: root/cont:$Name: $:$Id: TClassTable.cxx,v 1.28 2004/07/08 00:28:39 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *