// @(#)root/meta:$Id$
// Author: Bianca-Cristina Cristescu   09/07/13

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEnumConstant
#define ROOT_TEnumConstant


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TEnumConstant                                                        //
//                                                                      //
// TEnumConstant class defines a constant in the TEnum type.            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGlobal
#include "TGlobal.h"
#endif

class TEnum;

class TEnumConstant : public TGlobal {
private:
   const TEnum       *fEnum;  //the enum type
   Long64_t           fValue; //the value for the constant

public:
   TEnumConstant(): fEnum(0), fValue(-1) {}
   TEnumConstant(DataMemberInfo_t *info, const char* name, Long64_t value, TEnum* type);
   virtual ~TEnumConstant();

   virtual void *GetAddress() const { return (void*)fValue; }
   Long64_t      GetValue() const { return fValue; }
   const TEnum  *GetType() const { return fEnum; }

   ClassDef(TEnumConstant,2)  //Enum type constant
};

#endif

// @(#)root/meta:$Id$
// Author: Bianca-Cristina Cristescu   09/07/13

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TEnumConstant
#define ROOT_TEnumConstant


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TEnumConstant                                                        //
//                                                                      //
// TEnumConstant class defines a constant in the TEnum type.            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGlobal
#include "TGlobal.h"
#endif

class TEnum;

class TEnumConstant : public TGlobal {
private:
   const TEnum       *fEnum;  //the enum type
   Long64_t           fValue; //the value for the constant

public:
   TEnumConstant(): fEnum(0), fValue(-1) {}
   TEnumConstant(DataMemberInfo_t *info, const char* name, Long64_t value, TEnum* type);
   virtual ~TEnumConstant();

   virtual void *GetAddress() const { return (void*) &fValue; }
   Long64_t      GetValue() const { return fValue; }
   const TEnum  *GetType() const { return fEnum; }

   ClassDef(TEnumConstant,2)  //Enum type constant
};

#endif

Implement a GetAddress method that returns the address of the value data member
Implement a GetAddress method that returns the address of the value data member

this is different from the one of TGlobal which implies the presence of
information in the interpreter. This is done in order to support enum constants
which are created in the ROOT typesystem starting from the information in rootpcms.
*IMPORTANT NOTE*: the type of the enum constant value is Long64_t.
