00001 // @(#)root/meta:$Id: TMethod.h 24077 2008-05-31 19:39:09Z brun $ 00002 // Author: Rene Brun 09/02/95 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TMethod 00013 #define ROOT_TMethod 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TMethod // 00019 // // 00020 // Dictionary of a member function (method). // 00021 // // 00022 ////////////////////////////////////////////////////////////////////////// 00023 00024 #ifndef ROOT_TFunction 00025 #include "TFunction.h" 00026 #endif 00027 00028 class TList; 00029 class TDataMember; 00030 class TMethodCall; 00031 class TClass; 00032 00033 enum EMenuItemKind { 00034 kMenuNoMenu = 0, 00035 kMenuDialog, 00036 kMenuToggle, 00037 kMenuSubMenu 00038 }; 00039 00040 class TMethod : public TFunction { 00041 00042 private: 00043 TClass *fClass; //pointer to the class 00044 EMenuItemKind fMenuItem; //type of menuitem in context menu 00045 TString fGetter; //state getter in case this is a *TOGGLE method 00046 TMethodCall *fGetterMethod; //methodcall for state getter in case this is a *TOGGLE method 00047 TMethodCall *fSetterMethod; //methodcall for state setter in case this is a *TOGGLE method 00048 00049 void CreateSignature(); 00050 00051 public: 00052 TMethod(MethodInfo_t *info = 0, TClass *cl = 0); 00053 TMethod(const TMethod &org); 00054 TMethod& operator=(const TMethod &rhs); 00055 virtual ~TMethod(); 00056 virtual TObject *Clone(const char *newname="") const; 00057 TClass *GetClass() const { return fClass; } 00058 EMenuItemKind IsMenuItem() const { return fMenuItem; } 00059 virtual const char *GetCommentString(); 00060 virtual const char *Getter() const { return fGetter; } 00061 virtual TMethodCall *GetterMethod(); 00062 virtual TMethodCall *SetterMethod(); 00063 virtual TDataMember *FindDataMember(); 00064 virtual TList *GetListOfMethodArgs(); 00065 virtual void SetMenuItem(EMenuItemKind menuItem) {fMenuItem=menuItem;} 00066 00067 ClassDef(TMethod,0) //Dictionary for a class member function (method) 00068 }; 00069 00070 #endif