Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEnumConstant.h
Go to the documentation of this file.
1// @(#)root/meta:$Id$
2// Author: Bianca-Cristina Cristescu 09/07/13
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, 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_TEnumConstant
13#define ROOT_TEnumConstant
14
15
16//////////////////////////////////////////////////////////////////////////
17// //
18// TEnumConstant //
19// //
20// TEnumConstant class defines a constant in the TEnum type. //
21// //
22//////////////////////////////////////////////////////////////////////////
23
24#include "TGlobal.h"
25#include "TEnum.h"
26
27class TEnum;
28
29class TEnumConstant : public TGlobal {
30private:
31 const TEnum *fEnum; //the enum type
32 Long64_t fValue; //the value for the constant
33
34public:
35 TEnumConstant(): fEnum(nullptr), fValue(-1) {}
36 TEnumConstant(DataMemberInfo_t *info, const char* name, Long64_t value, TEnum* type);
37 virtual ~TEnumConstant();
38
39 void *GetAddress() const override { auto valPtr = &fValue; return (void*) const_cast<Long64_t*>(valPtr); }
40 Long64_t GetValue() const { return fValue; }
41 const TEnum *GetType() const { return fEnum; }
42
43 const char *GetTypeName() const override { return fEnum->GetQualifiedName(); }
44 const char *GetFullTypeName() const override { return GetTypeName(); }
45
46 ClassDefOverride(TEnumConstant,2) //Enum type constant
47};
48
49#endif
long long Long64_t
Definition RtypesCore.h:69
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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
The TEnumConstant class implements the constants of the enum type.
const TEnum * fEnum
const char * GetFullTypeName() const override
Get full type description of global variable, e,g.: "class TDirectory*".
const char * GetTypeName() const override
Get type of global variable, e,g.: "class TDirectory*" -> "TDirectory".
void * GetAddress() const override
Return address of global.
Long64_t fValue
Long64_t GetValue() const
const TEnum * GetType() const
virtual ~TEnumConstant()
Destructor.
The TEnum class implements the enum type.
Definition TEnum.h:33
const char * GetQualifiedName() const
Definition TEnum.h:77
Global variables class (global variables are obtained from CINT).
Definition TGlobal.h:28