// @(#)root/meta:$Id$
// Author: Fons Rademakers   04/02/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_TDataMember
#define ROOT_TDataMember


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TDataMember                                                          //
//                                                                      //
// Dictionary interface for a class data member.                        //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

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

class TList;
class TClass;
class TDataType;
class TMethodCall;

class TDataMember : public TDictionary {

private:
   enum { kObjIsPersistent = BIT(2) };

   DataMemberInfo_t   *fInfo;         //!pointer to CINT data member info
   TClass             *fClass;        //!pointer to the class
   TDataType          *fDataType;     //!pointer to data basic type descriptor

   Long_t              fOffset;       //offset
   Int_t               fSTLCont;      //STL type
   Long_t              fProperty;     //Property
   Int_t               fArrayDim;     //Number of array dimensions
   Int_t              *fArrayMaxIndex;//[fArrayDim] Maximum index for each dimension
   TString             fArrayIndex;   //String representation of the index variable name

   TString             fTypeName;     //data member type, e,g.: "class TDirectory*" -> "TDirectory".
   TString             fFullTypeName; //full type description of data member, e,g.: "class TDirectory*".
   TString             fTrueTypeName; //full type description with no typedef

   // The following fields allows to access all (even private) datamembers and
   // provide a possibility of having options with names and strings.
   // These options are defined in a comment to a field!
   TMethodCall        *fValueGetter;  //!method that returns a value;
   TMethodCall        *fValueSetter;  //!method which sets value;
   TList              *fOptions;      //list of possible values 0=no restrictions

   void Init(bool afterReading);

protected:
   TDataMember(const TDataMember&);
   TDataMember& operator=(const TDataMember&);

public:

   TDataMember(DataMemberInfo_t *info = 0, TClass *cl = 0);
   virtual       ~TDataMember();
   Int_t          GetArrayDim() const;
   DeclId_t       GetDeclId() const;
   Int_t          GetMaxIndex(Int_t dim) const;
   TClass        *GetClass() const { return fClass; }
   TDataType     *GetDataType() const { return fDataType; } //only for basic type
   Long_t         GetOffset() const;
   Long_t         GetOffsetCint() const;
   const char    *GetTypeName() const;
   const char    *GetFullTypeName() const;
   const char    *GetTrueTypeName() const;
   const char    *GetArrayIndex() const;
   Int_t          GetUnitSize() const;
   TList         *GetOptions() const;
   TMethodCall   *SetterMethod(TClass *cl);
   TMethodCall   *GetterMethod(TClass *cl = 0);

   Bool_t         IsBasic() const;
   Bool_t         IsEnum() const;
   Bool_t         IsaPointer() const;
   Bool_t         IsPersistent() const { return TestBit(kObjIsPersistent); }
   Int_t          IsSTLContainer();
   Bool_t         IsValid();
   Long_t         Property() const;
   void           SetClass(TClass* cl) { fClass = cl; }
   virtual bool   Update(DataMemberInfo_t *info);

   ClassDef(TDataMember,2)  //Dictionary for a class data member
};


// This class implements one option in options list. All Data members are public
// for cenvenience reasons.

class TOptionListItem : public TObject {

public:
   TDataMember     *fDataMember;     //!Data member to which this option belongs
   Long_t           fValue;          //Numerical value assigned to option
   Long_t           fValueMaskBit;   //Not used yet: bitmask used when option is a toggle group
   Long_t           fToggleMaskBit;  //Not used yet: bitmask used when toggling value
   TString          fOptName;        //Text assigned to option which appears in option menu
   TString          fOptLabel;       //Text (or enum) value assigned to option.
   TOptionListItem():
      fDataMember(0), fValue(0), fValueMaskBit(0), fToggleMaskBit(0)
   {}
   TOptionListItem(TDataMember *m,Long_t val, Long_t valmask, Long_t tglmask,
                   const char *name, const char *label);

   ClassDef(TOptionListItem,2); //Element in the list of options.
};

#endif
 TDataMember.h:1
 TDataMember.h:2
 TDataMember.h:3
 TDataMember.h:4
 TDataMember.h:5
 TDataMember.h:6
 TDataMember.h:7
 TDataMember.h:8
 TDataMember.h:9
 TDataMember.h:10
 TDataMember.h:11
 TDataMember.h:12
 TDataMember.h:13
 TDataMember.h:14
 TDataMember.h:15
 TDataMember.h:16
 TDataMember.h:17
 TDataMember.h:18
 TDataMember.h:19
 TDataMember.h:20
 TDataMember.h:21
 TDataMember.h:22
 TDataMember.h:23
 TDataMember.h:24
 TDataMember.h:25
 TDataMember.h:26
 TDataMember.h:27
 TDataMember.h:28
 TDataMember.h:29
 TDataMember.h:30
 TDataMember.h:31
 TDataMember.h:32
 TDataMember.h:33
 TDataMember.h:34
 TDataMember.h:35
 TDataMember.h:36
 TDataMember.h:37
 TDataMember.h:38
 TDataMember.h:39
 TDataMember.h:40
 TDataMember.h:41
 TDataMember.h:42
 TDataMember.h:43
 TDataMember.h:44
 TDataMember.h:45
 TDataMember.h:46
 TDataMember.h:47
 TDataMember.h:48
 TDataMember.h:49
 TDataMember.h:50
 TDataMember.h:51
 TDataMember.h:52
 TDataMember.h:53
 TDataMember.h:54
 TDataMember.h:55
 TDataMember.h:56
 TDataMember.h:57
 TDataMember.h:58
 TDataMember.h:59
 TDataMember.h:60
 TDataMember.h:61
 TDataMember.h:62
 TDataMember.h:63
 TDataMember.h:64
 TDataMember.h:65
 TDataMember.h:66
 TDataMember.h:67
 TDataMember.h:68
 TDataMember.h:69
 TDataMember.h:70
 TDataMember.h:71
 TDataMember.h:72
 TDataMember.h:73
 TDataMember.h:74
 TDataMember.h:75
 TDataMember.h:76
 TDataMember.h:77
 TDataMember.h:78
 TDataMember.h:79
 TDataMember.h:80
 TDataMember.h:81
 TDataMember.h:82
 TDataMember.h:83
 TDataMember.h:84
 TDataMember.h:85
 TDataMember.h:86
 TDataMember.h:87
 TDataMember.h:88
 TDataMember.h:89
 TDataMember.h:90
 TDataMember.h:91
 TDataMember.h:92
 TDataMember.h:93
 TDataMember.h:94
 TDataMember.h:95
 TDataMember.h:96
 TDataMember.h:97
 TDataMember.h:98
 TDataMember.h:99
 TDataMember.h:100
 TDataMember.h:101
 TDataMember.h:102
 TDataMember.h:103
 TDataMember.h:104
 TDataMember.h:105
 TDataMember.h:106
 TDataMember.h:107
 TDataMember.h:108
 TDataMember.h:109
 TDataMember.h:110
 TDataMember.h:111
 TDataMember.h:112
 TDataMember.h:113
 TDataMember.h:114
 TDataMember.h:115
 TDataMember.h:116
 TDataMember.h:117
 TDataMember.h:118
 TDataMember.h:119
 TDataMember.h:120
 TDataMember.h:121