Logo ROOT   6.08/07
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 #ifndef ROOT_TFunction
25 #include "TFunction.h"
26 #endif
27 
28 class TList;
29 class TDataMember;
30 class TMethodCall;
31 class TClass;
32 
38 };
39 
40 class TMethod : public TFunction {
41 
42 private:
43  TClass *fClass; //pointer to the class
44  EMenuItemKind fMenuItem; //type of menuitem in context menu
45  TString fGetter; //state getter in case this is a *TOGGLE method
46  TMethodCall *fGetterMethod; //methodcall for state getter in case this is a *TOGGLE method
47  TMethodCall *fSetterMethod; //methodcall for state setter in case this is a *TOGGLE method
48 
49  void CreateSignature();
50  void SetMenuItem(const char *docstring); //Must not be virtual. Used in constructor.
51 public:
52  TMethod(MethodInfo_t *info = 0, TClass *cl = 0);
53  TMethod(const TMethod &org);
54  TMethod& operator=(const TMethod &rhs);
55  virtual ~TMethod();
56  virtual TObject *Clone(const char *newname="") const;
57  TClass *GetClass() const { return fClass; }
58  EMenuItemKind IsMenuItem() const { return fMenuItem; }
59  virtual Bool_t IsValid();
60  virtual const char *GetCommentString();
61  virtual const char *Getter() const { return fGetter; }
62  virtual TMethodCall *GetterMethod();
63  virtual TMethodCall *SetterMethod();
64  virtual TDataMember *FindDataMember();
65  virtual TList *GetListOfMethodArgs();
66  virtual void SetMenuItem(EMenuItemKind menuItem) {fMenuItem=menuItem;}
67 
68  virtual Bool_t Update(MethodInfo_t *info);
69 
70  ClassDef(TMethod,0) //Dictionary for a class member function (method)
71 };
72 
73 #endif
TMethod(MethodInfo_t *info=0, TClass *cl=0)
Default TMethod ctor.
Definition: TMethod.cxx:39
EMenuItemKind
Definition: TMethod.h:33
EMenuItemKind fMenuItem
Definition: TMethod.h:44
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:33
virtual const char * Getter() const
Definition: TMethod.h:61
virtual Bool_t IsValid()
Return true if this function object is pointing to a currently loaded function.
Definition: TMethod.cxx:275
void SetMenuItem(const char *docstring)
Set the menu item as prescribed in the doctstring.
Definition: TMethod.cxx:317
Basic string class.
Definition: TString.h:137
bool Bool_t
Definition: RtypesCore.h:59
TMethodCall * fSetterMethod
Definition: TMethod.h:47
virtual TDataMember * FindDataMember()
Tries to guess DataMember from comment string and Method&#39;s name <==(only if 1 Argument!).
Definition: TMethod.cxx:132
void CreateSignature()
Using the CINT method arg information create a complete signature string.
Definition: TMethod.cxx:114
#define ClassDef(name, id)
Definition: Rtypes.h:254
TMethod & operator=(const TMethod &rhs)
Assignment operator.
Definition: TMethod.cxx:66
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
Definition: TMethod.cxx:105
Method or function calling interface.
Definition: TMethodCall.h:41
A doubly linked list.
Definition: TList.h:47
virtual TMethodCall * SetterMethod()
Return call environment for this method in case this is a *TOGGLE method which takes a single boolean...
Definition: TMethod.cxx:293
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();...
Definition: TMethod.cxx:305
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
TClass * fClass
Definition: TMethod.h:43
virtual TObject * Clone(const char *newname="") const
Clone method.
Definition: TMethod.cxx:95
virtual Bool_t Update(MethodInfo_t *info)
Update the TMethod to reflect the new info.
Definition: TMethod.cxx:342
TString fGetter
Definition: TMethod.h:45
EMenuItemKind IsMenuItem() const
Definition: TMethod.h:58
#define org(otri, vertexptr)
Definition: triangle.c:1037
Mother of all ROOT objects.
Definition: TObject.h:37
Global functions class (global functions are obtained from CINT).
Definition: TFunction.h:30
virtual TMethodCall * GetterMethod()
Return call environment for the getter method in case this is a *TOGGLE method (for the context menu)...
Definition: TMethod.cxx:262
Each ROOT class (see TClass) has a linked list of methods.
Definition: TMethod.h:40
TClass * GetClass() const
Definition: TMethod.h:57
virtual ~TMethod()
Cleanup.
Definition: TMethod.cxx:86
virtual void SetMenuItem(EMenuItemKind menuItem)
Definition: TMethod.h:66
TMethodCall * fGetterMethod
Definition: TMethod.h:46