// @(#)root/meta:$Id$
// Author: Rene Brun   13/11/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TGlobal
#define ROOT_TGlobal


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TGlobal                                                              //
//                                                                      //
// Global variables class (global variables are obtained from CINT).    //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TDictionary
#include "TDictionary.h"
#endif


class TGlobal : public TDictionary {

private:
   DataMemberInfo_t  *fInfo;      //!pointer to CINT data member info

public:
   TGlobal(DataMemberInfo_t *info = 0);
   TGlobal (const TGlobal &);
   TGlobal &operator=(const TGlobal &);

   virtual       ~TGlobal();
   virtual Int_t  GetArrayDim() const;
   virtual DeclId_t GetDeclId() const;
   virtual Int_t  GetMaxIndex(Int_t dim) const;
   virtual void  *GetAddress() const;
   virtual const char *GetTypeName() const;
   virtual const char *GetFullTypeName() const;
   virtual Bool_t IsValid();
   virtual Long_t Property() const;
   virtual bool   Update(DataMemberInfo_t *info);

   ClassDef(TGlobal,2)  //Global variable class
};

   //Class to map the "funcky" globals and be able to add them to the list of globals.
   class TGlobalMappedFunction: public TGlobal {
   public:
      typedef void* (*GlobalFunc_t)();
      TGlobalMappedFunction(const char* name, const char* type,
                            GlobalFunc_t funcPtr):fFuncPtr(funcPtr)
      {
         SetNameTitle(name, type);
      }
      virtual       ~TGlobalMappedFunction() {}
      Int_t          GetArrayDim() const { return 0;}
      DeclId_t       GetDeclId() const { return (DeclId_t)(fFuncPtr); } // Used as DeclId because of uniqueness
      Int_t          GetMaxIndex(Int_t /*dim*/) const { return -1; }
      void          *GetAddress() const { return (*fFuncPtr)(); }
      const char    *GetTypeName() const { return fTitle; }
      const char    *GetFullTypeName() const { return fTitle; }
      Long_t         Property() const { return 0; }
      virtual bool   Update(DataMemberInfo_t * /*info*/) { return false; }
      static  void   Add(TGlobalMappedFunction* gmf);

   private:

      GlobalFunc_t fFuncPtr; // Function to call to get the address

      TGlobalMappedFunction &operator=(const TGlobal &); // not implemented.
      // Some of the special ones are created before the list is create e.g gFile
      // We need to buffer them.
      static TList&  GetEarlyRegisteredGlobals();

      friend class TROOT;
   };

#endif
 TGlobal.h:1
 TGlobal.h:2
 TGlobal.h:3
 TGlobal.h:4
 TGlobal.h:5
 TGlobal.h:6
 TGlobal.h:7
 TGlobal.h:8
 TGlobal.h:9
 TGlobal.h:10
 TGlobal.h:11
 TGlobal.h:12
 TGlobal.h:13
 TGlobal.h:14
 TGlobal.h:15
 TGlobal.h:16
 TGlobal.h:17
 TGlobal.h:18
 TGlobal.h:19
 TGlobal.h:20
 TGlobal.h:21
 TGlobal.h:22
 TGlobal.h:23
 TGlobal.h:24
 TGlobal.h:25
 TGlobal.h:26
 TGlobal.h:27
 TGlobal.h:28
 TGlobal.h:29
 TGlobal.h:30
 TGlobal.h:31
 TGlobal.h:32
 TGlobal.h:33
 TGlobal.h:34
 TGlobal.h:35
 TGlobal.h:36
 TGlobal.h:37
 TGlobal.h:38
 TGlobal.h:39
 TGlobal.h:40
 TGlobal.h:41
 TGlobal.h:42
 TGlobal.h:43
 TGlobal.h:44
 TGlobal.h:45
 TGlobal.h:46
 TGlobal.h:47
 TGlobal.h:48
 TGlobal.h:49
 TGlobal.h:50
 TGlobal.h:51
 TGlobal.h:52
 TGlobal.h:53
 TGlobal.h:54
 TGlobal.h:55
 TGlobal.h:56
 TGlobal.h:57
 TGlobal.h:58
 TGlobal.h:59
 TGlobal.h:60
 TGlobal.h:61
 TGlobal.h:62
 TGlobal.h:63
 TGlobal.h:64
 TGlobal.h:65
 TGlobal.h:66
 TGlobal.h:67
 TGlobal.h:68
 TGlobal.h:69
 TGlobal.h:70
 TGlobal.h:71
 TGlobal.h:72
 TGlobal.h:73
 TGlobal.h:74
 TGlobal.h:75
 TGlobal.h:76
 TGlobal.h:77
 TGlobal.h:78
 TGlobal.h:79
 TGlobal.h:80
 TGlobal.h:81
 TGlobal.h:82
 TGlobal.h:83
 TGlobal.h:84
 TGlobal.h:85