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:
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:73
#define ClassDefOverride(name, id)
Definition Rtypes.h:329
char name[80]
Definition TGX11.cxx:110
int type
Definition TGX11.cxx:121
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:74
Global variables class (global variables are obtained from CINT).
Definition TGlobal.h:28