Logo ROOT  
Reference Guide
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 
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
TMethod::GetListOfMethodArgs
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();.
Definition: TMethod.cxx:308
TMethod::GetterMethod
virtual TMethodCall * GetterMethod()
Return call environment for the getter method in case this is a *TOGGLE method (for the context menu)...
Definition: TMethod.cxx:265
TMethod::fMenuItem
EMenuItemKind fMenuItem
Definition: TMethod.h:42
TMethod::IsValid
virtual Bool_t IsValid()
Return true if this function object is pointing to a currently loaded function.
Definition: TMethod.cxx:278
TMethod::operator=
TMethod & operator=(const TMethod &rhs)
Assignment operator.
Definition: TMethod.cxx:68
TFunction.h
TMethod::TMethod
TMethod(MethodInfo_t *info=0, TClass *cl=0)
Default TMethod ctor.
Definition: TMethod.cxx:41
TMethod::fGetterMethod
TMethodCall * fGetterMethod
Definition: TMethod.h:44
EMenuItemKind
EMenuItemKind
Definition: TMethod.h:31
TDataMember
Definition: TDataMember.h:31
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TMethod::SetMenuItem
virtual void SetMenuItem(EMenuItemKind menuItem)
Definition: TMethod.h:64
kMenuToggle
@ kMenuToggle
Definition: TMethod.h:34
TMethod::GetCommentString
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
Definition: TMethod.cxx:107
TMethod::fClass
TClass * fClass
Definition: TMethod.h:41
TMethod::FindDataMember
virtual TDataMember * FindDataMember()
Tries to guess DataMember from comment string and Method's name <==(only if 1 Argument!...
Definition: TMethod.cxx:134
TMethod::GetClass
TClass * GetClass() const
Definition: TMethod.h:55
TMethod
Definition: TMethod.h:38
kMenuDialog
@ kMenuDialog
Definition: TMethod.h:33
org
#define org(otri, vertexptr)
Definition: triangle.c:1037
TMethod::fGetter
TString fGetter
Definition: TMethod.h:43
TMethod::Getter
virtual const char * Getter() const
Definition: TMethod.h:59
TMethod::fSetterMethod
TMethodCall * fSetterMethod
Definition: TMethod.h:45
TMethod::~TMethod
virtual ~TMethod()
Cleanup.
Definition: TMethod.cxx:88
TClass
Definition: TClass.h:80
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TMethod::SetterMethod
virtual TMethodCall * SetterMethod()
Return call environment for this method in case this is a *TOGGLE method which takes a single boolean...
Definition: TMethod.cxx:296
TMethod::Clone
virtual TObject * Clone(const char *newname="") const
Clone method.
Definition: TMethod.cxx:97
kMenuSubMenu
@ kMenuSubMenu
Definition: TMethod.h:35
TMethodCall
Definition: TMethodCall.h:37
kMenuNoMenu
@ kMenuNoMenu
Definition: TMethod.h:32
TMethod::CreateSignature
void CreateSignature()
Using the CINT method arg information create a complete signature string.
Definition: TMethod.cxx:116
TFunction
Definition: TFunction.h:30
TList
Definition: TList.h:44
TMethod::SetMenuItem
void SetMenuItem(const char *docstring)
Set the menu item as prescribed in the doctstring.
Definition: TMethod.cxx:320
TMethod::Update
virtual Bool_t Update(MethodInfo_t *info)
Update the TMethod to reflect the new info.
Definition: TMethod.cxx:345
TMethod::IsMenuItem
EMenuItemKind IsMenuItem() const
Definition: TMethod.h:56