Logo ROOT   6.10/09
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(MethodInfo_t *info=0, TClass *cl=0)
Default TMethod ctor.
Definition: TMethod.cxx:39
EMenuItemKind
Definition: TMethod.h:31
EMenuItemKind fMenuItem
Definition: TMethod.h:42
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
virtual const char * Getter() const
Definition: TMethod.h:59
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:129
bool Bool_t
Definition: RtypesCore.h:59
TMethodCall * fSetterMethod
Definition: TMethod.h:45
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:297
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:37
A doubly linked list.
Definition: TList.h:43
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:71
TClass * fClass
Definition: TMethod.h:41
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:43
EMenuItemKind IsMenuItem() const
Definition: TMethod.h:56
#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:28
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:38
TClass * GetClass() const
Definition: TMethod.h:55
virtual ~TMethod()
Cleanup.
Definition: TMethod.cxx:86
virtual void SetMenuItem(EMenuItemKind menuItem)
Definition: TMethod.h:64
TMethodCall * fGetterMethod
Definition: TMethod.h:44