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() override;
48 void SetMenuItem(const char *docstring); //Must not be virtual. Used in constructor.
49public:
50 TMethod(MethodInfo_t *info = nullptr, TClass *cl = nullptr);
51 TMethod(const TMethod &org);
52 virtual ~TMethod();
53 TMethod& operator=(const TMethod &rhs);
54 TObject *Clone(const char *newname="") const override;
55 TClass *GetClass() const { return fClass; }
57 Bool_t IsValid() override;
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 Bool_t Update(MethodInfo_t *info) override;
67
68 ClassDefOverride(TMethod,0) //Dictionary for a class member function (method)
69};
70
71#endif
bool Bool_t
Definition RtypesCore.h:63
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t org
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:81
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
Bool_t Update(MethodInfo_t *info) override
Update the TMethod to reflect the new info.
Definition TMethod.cxx:344
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 void SetMenuItem(EMenuItemKind menuItem)
Definition TMethod.h:64
TMethodCall * fGetterMethod
Definition TMethod.h:44
EMenuItemKind IsMenuItem() const
Definition TMethod.h:56
Bool_t IsValid() override
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
void CreateSignature() override
Using the CINT method arg information create a complete signature string.
Definition TMethod.cxx:116
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
TObject * Clone(const char *newname="") const override
Clone method.
Definition TMethod.cxx:97
Mother of all ROOT objects.
Definition TObject.h:41
Basic string class.
Definition TString.h:139