Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
26class TList;
27class TDataMember;
28class TMethodCall;
29class TClass;
30
36};
37
38class TMethod : public TFunction {
39
40private:
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.
49public:
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; }
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
bool Bool_t
Definition RtypesCore.h:63
#define ClassDef(name, id)
Definition Rtypes.h:325
EMenuItemKind
Definition TMethod.h:31
@ kMenuSubMenu
Definition TMethod.h:35
@ kMenuDialog
Definition TMethod.h:33
@ kMenuToggle
Definition TMethod.h:34
@ kMenuNoMenu
Definition TMethod.h:32
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
All ROOT classes may have RTTI (run time type identification) support added.
Definition TDataMember.h:31
Global functions class (global functions are obtained from CINT).
Definition TFunction.h:30
A doubly linked list.
Definition TList.h:38
Method or function calling interface.
Definition TMethodCall.h:37
Each ROOT class (see TClass) has a linked list of methods.
Definition TMethod.h:38
TMethodCall * fSetterMethod
Definition TMethod.h:45
virtual const char * GetCommentString()
Returns a comment string from the class declaration.
Definition TMethod.cxx:107
TString fGetter
Definition TMethod.h:43
TMethod & operator=(const TMethod &rhs)
Assignment operator.
Definition TMethod.cxx:68
virtual const char * Getter() const
Definition TMethod.h:59
TClass * fClass
Definition TMethod.h:41
virtual TDataMember * FindDataMember()
Tries to guess DataMember from comment string and Method's name <==(only if 1 Argument!...
Definition TMethod.cxx:134
TClass * GetClass() const
Definition TMethod.h:55
void CreateSignature()
Using the CINT method arg information create a complete signature string.
Definition TMethod.cxx:116
void SetMenuItem(const char *docstring)
Set the menu item as prescribed in the doctstring.
Definition TMethod.cxx:319
virtual ~TMethod()
Cleanup.
Definition TMethod.cxx:88
EMenuItemKind fMenuItem
Definition TMethod.h:42
virtual TMethodCall * SetterMethod()
Return call environment for this method in case this is a *TOGGLE method which takes a single boolean...
Definition TMethod.cxx:295
virtual Bool_t Update(MethodInfo_t *info)
Update the TMethod to reflect the new info.
Definition TMethod.cxx:344
virtual void SetMenuItem(EMenuItemKind menuItem)
Definition TMethod.h:64
TMethodCall * fGetterMethod
Definition TMethod.h:44
virtual TObject * Clone(const char *newname="") const
Clone method.
Definition TMethod.cxx:97
EMenuItemKind IsMenuItem() const
Definition TMethod.h:56
virtual Bool_t IsValid()
Return true if this function object is pointing to a currently loaded function.
Definition TMethod.cxx:277
virtual TList * GetListOfMethodArgs()
Returns methodarg list and additionally updates fDataMember in TMethod by calling FindDataMember();.
Definition TMethod.cxx:307
virtual TMethodCall * GetterMethod()
Return call environment for the getter method in case this is a *TOGGLE method (for the context menu)...
Definition TMethod.cxx:264
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:136
#define org(otri, vertexptr)
Definition triangle.c:1038