Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/meta:$Id$
0002 // Author: Bianca-Cristina Cristescu   09/07/13
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2013, 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_TEnumConstant
0013 #define ROOT_TEnumConstant
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TEnumConstant                                                        //
0019 //                                                                      //
0020 // TEnumConstant class defines a constant in the TEnum type.            //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TGlobal.h"
0025 #include "TEnum.h"
0026 
0027 class TEnum;
0028 
0029 class TEnumConstant : public TGlobal {
0030 private:
0031    const TEnum       *fEnum;  //the enum type
0032    Long64_t           fValue; //the value for the constant
0033 
0034 public:
0035    TEnumConstant(): fEnum(nullptr), fValue(-1) {}
0036    TEnumConstant(DataMemberInfo_t *info, const char* name, Long64_t value, TEnum* type);
0037    virtual ~TEnumConstant();
0038 
0039    void *GetAddress() const override { auto valPtr = &fValue; return (void*) const_cast<Long64_t*>(valPtr); }
0040    Long64_t      GetValue() const { return fValue; }
0041    const TEnum  *GetType() const { return fEnum; }
0042 
0043    const char *GetTypeName() const override { return fEnum->GetQualifiedName(); }
0044    const char *GetFullTypeName() const override { return GetTypeName(); }
0045 
0046    ClassDefOverride(TEnumConstant,2)  //Enum type constant
0047 };
0048 
0049 #endif