Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:16

0001 // @(#)root/meta:$Id$
0002 // Author: Rene Brun   09/02/95
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, 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_TMethod
0013 #define ROOT_TMethod
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TMethod                                                              //
0019 //                                                                      //
0020 // Dictionary of a member function (method).                            //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TFunction.h"
0025 
0026 class TList;
0027 class TDataMember;
0028 class TMethodCall;
0029 class TClass;
0030 
0031 enum EMenuItemKind {
0032    kMenuNoMenu = 0,
0033    kMenuDialog,
0034    kMenuToggle,
0035    kMenuSubMenu
0036 };
0037 
0038 class TMethod : public TFunction {
0039 
0040 private:
0041    TClass                 *fClass;           //pointer to the class
0042    EMenuItemKind           fMenuItem;        //type of menuitem in context menu
0043    TString                 fGetter;          //state getter in case this is a *TOGGLE method
0044    TMethodCall            *fGetterMethod;    //methodcall for state getter in case this is a *TOGGLE method
0045    TMethodCall            *fSetterMethod;    //methodcall for state setter in case this is a *TOGGLE method
0046 
0047    void                    CreateSignature() override;
0048    void                    SetMenuItem(const char *docstring);    //Must not be virtual. Used in constructor.
0049 public:
0050    TMethod(MethodInfo_t *info = nullptr, TClass *cl = nullptr);
0051    TMethod(const TMethod &org);
0052    virtual ~TMethod();
0053    TMethod&                operator=(const TMethod &rhs);
0054    TObject                *Clone(const char *newname="") const override;
0055    TClass                 *GetClass() const { return fClass; }
0056    EMenuItemKind           IsMenuItem() const { return fMenuItem; }
0057    Bool_t                  IsValid() override;
0058    virtual const char     *GetCommentString();
0059    virtual const char     *Getter() const { return fGetter; }
0060    virtual TMethodCall    *GetterMethod();
0061    virtual TMethodCall    *SetterMethod();
0062    virtual TDataMember    *FindDataMember();
0063    virtual TList          *GetListOfMethodArgs();
0064    virtual void            SetMenuItem(EMenuItemKind menuItem) { fMenuItem = menuItem; }
0065 
0066    Bool_t                  Update(MethodInfo_t *info) override;
0067 
0068    ClassDefOverride(TMethod,0)  //Dictionary for a class member function (method)
0069 };
0070 
0071 #endif