Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
27 class TEnum;
28 
29 class TEnumConstant : public TGlobal {
30 private:
31  const TEnum *fEnum; //the enum type
32  Long64_t fValue; //the value for the constant
33 
34 public:
35  TEnumConstant(): fEnum(0), 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