Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TDataType.h
Go to the documentation of this file.
1// @(#)root/meta:$Id$
2// Author: Rene Brun 04/02/95
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TDataType
13#define ROOT_TDataType
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TDataType //
19// //
20// Basic data type descriptor (datatype information is obtained from //
21// CINT). //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25#include "TDictionary.h"
26
27
29 kChar_t = 1, kUChar_t = 11, kShort_t = 2, kUShort_t = 12,
30 kInt_t = 3, kUInt_t = 13, kLong_t = 4, kULong_t = 14,
31 kFloat_t = 5, kDouble_t = 8, kDouble32_t = 9, kchar = 10,
32 kBool_t = 18, kLong64_t = 16, kULong64_t = 17, kOther_t = -1,
34 kCounter = 6, kCharStar = 7, kBits = 15 /* for compatibility with TStreamerInfo */,
35 kVoid_t = 20,
36
39 // could add "long int" etc
41};
42
43
44class TDataType : public TDictionary {
45
46private:
47 TypedefInfo_t *fInfo; //!pointer to CINT typedef info
48 Int_t fSize; //size of type
49 EDataType fType; //type id
50 Long_t fProperty; //The property information for the (potential) underlying class
51 TString fTrueName; //Qualified name of the (potential) underlying class, e.g. "MyClass*const*"
52 Int_t fTypeNameIdx; //Start of class name part of the (potential) underlying class in fTrueName
53 Int_t fTypeNameLen; //Strlen of class name part of the (potential) underlying class in fTrueName
54 static TDataType* fgBuiltins[kNumDataTypes]; //Array of builtins
55
56 void CheckInfo();
57 void SetType(const char *name);
58
59protected:
60 TDataType(const TDataType&);
62
63public:
64 TDataType(TypedefInfo_t *info = nullptr);
65 TDataType(const char *typenam);
66 virtual ~TDataType();
67 Int_t Size() const;
68 Int_t GetType() const { return (Int_t)fType; }
70 const char *GetFullTypeName() const;
71 const char *AsString(void *buf) const;
72 Long_t Property() const override;
73
74 static const char *GetTypeName(EDataType type);
76 static EDataType GetType(const std::type_info &typeinfo);
77 static void AddBuiltins(TCollection* types);
78
79 ClassDefOverride(TDataType,2) //Basic data type descriptor
80};
81
82#endif
long Long_t
Definition RtypesCore.h:54
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
EDataType
Definition TDataType.h:28
@ kNoType_t
Definition TDataType.h:33
@ kFloat_t
Definition TDataType.h:31
@ kULong64_t
Definition TDataType.h:32
@ kInt_t
Definition TDataType.h:30
@ kNumDataTypes
Definition TDataType.h:40
@ kchar
Definition TDataType.h:31
@ kLong_t
Definition TDataType.h:30
@ kDouble32_t
Definition TDataType.h:31
@ kShort_t
Definition TDataType.h:29
@ kBool_t
Definition TDataType.h:32
@ kBits
Definition TDataType.h:34
@ kDataTypeAliasSignedChar_t
Definition TDataType.h:38
@ kULong_t
Definition TDataType.h:30
@ kLong64_t
Definition TDataType.h:32
@ kVoid_t
Definition TDataType.h:35
@ kUShort_t
Definition TDataType.h:29
@ kDouble_t
Definition TDataType.h:31
@ kCharStar
Definition TDataType.h:34
@ kChar_t
Definition TDataType.h:29
@ kUChar_t
Definition TDataType.h:29
@ kDataTypeAliasUnsigned_t
Definition TDataType.h:37
@ kCounter
Definition TDataType.h:34
@ kUInt_t
Definition TDataType.h:30
@ kFloat16_t
Definition TDataType.h:33
@ kOther_t
Definition TDataType.h:32
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
Collection abstract base class.
Definition TCollection.h:65
Basic data type descriptor (datatype information is obtained from CINT).
Definition TDataType.h:44
Int_t GetType() const
Definition TDataType.h:68
void CheckInfo()
Refresh the underlying information.
virtual ~TDataType()
TDataType dtor deletes adopted CINT TypedefInfo object.
TypedefInfo_t * fInfo
Definition TDataType.h:47
static TDataType * fgBuiltins[kNumDataTypes]
Definition TDataType.h:54
const char * GetFullTypeName() const
Get full type description of typedef, e,g.: "class TDirectory*".
Int_t fTypeNameLen
Definition TDataType.h:53
Int_t fSize
pointer to CINT typedef info
Definition TDataType.h:48
Long_t Property() const override
Get property description word. For meaning of bits see EProperty.
Long_t fProperty
Definition TDataType.h:50
const char * AsString(void *buf) const
Return string containing value in buffer formatted according to the basic data type.
TString GetTypeName()
Get basic type of typedef, e,g.: "class TDirectory*" -> "TDirectory".
EDataType fType
Definition TDataType.h:49
static void AddBuiltins(TCollection *types)
Create the TDataType objects for builtins.
static TDataType * GetDataType(EDataType type)
Given a EDataType type, get the TDataType* that represents it.
TDataType & operator=(const TDataType &)
assignment operator
Definition TDataType.cxx:86
TString fTrueName
Definition TDataType.h:51
void SetType(const char *name)
Set type id depending on name.
Int_t Size() const
Get size of basic typedef'ed type.
Int_t fTypeNameIdx
Definition TDataType.h:52
This class defines an abstract interface that must be implemented by all classes that contain diction...
Basic string class.
Definition TString.h:139