Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TMethod.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Rene Brun 09/02/95
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TMethod
13 #define ROOT_TMethod
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TMethod //
19 // //
20 // Dictionary of a member function (method). //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TFunction.h"
25 
26 class TList;
27 class TDataMember;
28 class TMethodCall;
29 class TClass;
30 
31 enum EMenuItemKind {
32  kMenuNoMenu = 0,
33  kMenuDialog,
34  kMenuToggle,
35  kMenuSubMenu
36 };
37 
38 class TMethod : public TFunction {
39 
40 private:
41  TClass *fClass; //pointer to the class
42  EMenuItemKind fMenuItem; //type of menuitem in context menu
43  TString fGetter; //state getter in case this is a *TOGGLE method
44  TMethodCall *fGetterMethod; //methodcall for state getter in case this is a *TOGGLE method
45  TMethodCall *fSetterMethod; //methodcall for state setter in case this is a *TOGGLE method
46 
47  void CreateSignature();
48  void SetMenuItem(const char *docstring); //Must not be virtual. Used in constructor.
49 public:
50  TMethod(MethodInfo_t *info = 0, TClass *cl = 0);
51  TMethod(const TMethod &org);
52  TMethod& operator=(const TMethod &rhs);
53  virtual ~TMethod();
54  virtual TObject *Clone(const char *newname="") const;
55  TClass *GetClass() const { return fClass; }
56  EMenuItemKind IsMenuItem() const { return fMenuItem; }
57  virtual Bool_t IsValid();
58  virtual const char *GetCommentString();
59  virtual const char *Getter() const { return fGetter; }
60  virtual TMethodCall *GetterMethod();
61  virtual TMethodCall *SetterMethod();
62  virtual TDataMember *FindDataMember();
63  virtual TList *GetListOfMethodArgs();
64  virtual void SetMenuItem(EMenuItemKind menuItem) {fMenuItem=menuItem;}
65 
66  virtual Bool_t Update(MethodInfo_t *info);
67 
68  ClassDef(TMethod,0) //Dictionary for a class member function (method)
69 };
70 
71 #endif