Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:37

0001 // @(#)root/meta:$Id$
0002 // Author: Rene Brun   04/02/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TDataType
0013 #define ROOT_TDataType
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TDataType                                                            //
0019 //                                                                      //
0020 // Basic data type descriptor (datatype information is obtained from    //
0021 // CINT).                                                               //
0022 //                                                                      //
0023 //////////////////////////////////////////////////////////////////////////
0024 
0025 #include "TDictionary.h"
0026 
0027 
0028 enum EDataType {
0029    kChar_t   = 1,  kUChar_t  = 11, kShort_t    = 2,  kUShort_t = 12,
0030    kInt_t    = 3,  kUInt_t   = 13, kLong_t     = 4,  kULong_t  = 14,
0031    kFloat_t  = 5,  kDouble_t =  8, kDouble32_t = 9,  kchar     = 10,
0032    kBool_t   = 18, kLong64_t = 16, kULong64_t  = 17, kOther_t  = -1,
0033    kNoType_t = 0,  kFloat16_t= 19,
0034    kCounter  =  6, kCharStar = 7,  kBits     = 15 /* for compatibility with TStreamerInfo */,
0035    kVoid_t   = 20,
0036 
0037    kDataTypeAliasUnsigned_t = 21,
0038    kDataTypeAliasSignedChar_t = 22,
0039    // could add "long int" etc
0040    kNumDataTypes
0041 };
0042 
0043 
0044 class TDataType : public TDictionary {
0045 
0046 private:
0047    TypedefInfo_t    *fInfo;     //!pointer to CINT typedef info
0048    Int_t             fSize;     //size of type
0049    EDataType         fType;     //type id
0050    Long_t            fProperty; //The property information for the (potential) underlying class
0051    TString           fTrueName; //Qualified name of the (potential) underlying class, e.g. "MyClass*const*"
0052    Int_t             fTypeNameIdx; //Start of class name part of the (potential) underlying class in fTrueName
0053    Int_t             fTypeNameLen; //Strlen of class name part of the (potential) underlying class in fTrueName
0054    static TDataType* fgBuiltins[kNumDataTypes]; //Array of builtins
0055 
0056    void CheckInfo();
0057    void SetType(const char *name);
0058 
0059 protected:
0060    TDataType(const TDataType&);
0061    TDataType& operator=(const TDataType&);
0062 
0063 public:
0064    TDataType(TypedefInfo_t *info = nullptr);
0065    TDataType(const char *typenam);
0066    virtual       ~TDataType();
0067    Int_t          Size() const;
0068    Int_t          GetType() const { return (Int_t)fType; }
0069    TString        GetTypeName();
0070    const char    *GetFullTypeName() const;
0071    const char    *AsString(void *buf) const;
0072    Long_t         Property() const override;
0073 
0074    static const char *GetTypeName(EDataType type);
0075    static TDataType  *GetDataType(EDataType type);
0076    static EDataType GetType(const std::type_info &typeinfo);
0077    static void AddBuiltins(TCollection* types);
0078 
0079    ClassDefOverride(TDataType,2)  //Basic data type descriptor
0080 };
0081 
0082 #endif