ROOT logo
// @(#)root/meta:$Id: TMethodArg.cxx 24077 2008-05-31 19:39:09Z brun $
// Author: Rene Brun   04/02/95

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TMethodArg.h"
#include "TROOT.h"
#include "TInterpreter.h"
#include "Strlen.h"
#include "TMethod.h"
#include "TMethodCall.h"
#include "TDataMember.h"

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  Each ROOT method (see TMethod) has a linked list of its arguments.  //
//  This class describes one single method argument.                    //
//  The method argument info is obtained via the CINT api.              //
//  See class TCint.                                                    //
//                                                                      //
//  The method argument information is used a.o. in the TContextMenu    //
//  and THtml classes.                                                  //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

ClassImp(TMethodArg)

//______________________________________________________________________________
TMethodArg::TMethodArg(MethodArgInfo_t *info, TFunction *method) : TDictionary()
{
   // Default TMethodArg ctor. TMethodArgs are constructed in TFunction
   // via a call to TCint::CreateListOfMethodArgs().

   fDataMember = 0;
   fInfo       = info;
   fMethod     = method;
   if (fInfo) {
      SetName(gCint->MethodArgInfo_Name(fInfo));
      SetTitle(gCint->MethodArgInfo_TypeName(fInfo));
   }
}

//______________________________________________________________________________
TMethodArg::~TMethodArg()
{
   // TMethodArg dtor deletes adopted CINT MethodArgInfo object.

   if (fInfo) gCint->MethodArgInfo_Delete(fInfo);
}

//______________________________________________________________________________
const char *TMethodArg::GetDefault() const
{
   // Get default value of method argument.

   return gCint->MethodArgInfo_DefaultValue(fInfo);
}

//______________________________________________________________________________
const char *TMethodArg::GetTypeName() const
{
   // Get type of method argument, e.g.: "class TDirectory*" -> "TDirectory"
   // Result needs to be used or copied immediately.

   return gCint->TypeName(gCint->MethodArgInfo_TypeName(fInfo));
}

//______________________________________________________________________________
const char *TMethodArg::GetFullTypeName() const
{
   // Get full type description of method argument, e.g.: "class TDirectory*".

   return gCint->MethodArgInfo_TypeName(fInfo);
}

//______________________________________________________________________________
Long_t TMethodArg::Property() const
{
   // Get property description word. For meaning of bits see EProperty.

   return gCint->MethodArgInfo_Property(fInfo);
}

//______________________________________________________________________________
TList *TMethodArg::GetOptions() const
{
   // Returns list of possible options - according to pointed datamember.
   // If there is no datamember field assigned to this methodarg - returns 0.

   return (TList*)(fDataMember ? fDataMember->GetOptions() : 0);
}

//______________________________________________________________________________
TDataMember *TMethodArg::GetDataMember() const
{
   // Returns TDataMember pointed by this methodarg.
   // If you want to specify list of options or current value for your
   // MethodArg (i.e. it is used as initial values in argument-asking dialogs
   // popped up from context-meny),you can get this value from one of data
   // members of the class.
   // The only restriction is, that this DataMember object must have its
   // Getter/Setter methods set-up correctly - for details look at TDataMember.
   // To learn how to specify the data member to which the argument should
   // "point", look at TMethod. This is TMethod which sets up fDataMember,
   // so it could work correctly.

   return fDataMember;
}

 TMethodArg.cxx:1
 TMethodArg.cxx:2
 TMethodArg.cxx:3
 TMethodArg.cxx:4
 TMethodArg.cxx:5
 TMethodArg.cxx:6
 TMethodArg.cxx:7
 TMethodArg.cxx:8
 TMethodArg.cxx:9
 TMethodArg.cxx:10
 TMethodArg.cxx:11
 TMethodArg.cxx:12
 TMethodArg.cxx:13
 TMethodArg.cxx:14
 TMethodArg.cxx:15
 TMethodArg.cxx:16
 TMethodArg.cxx:17
 TMethodArg.cxx:18
 TMethodArg.cxx:19
 TMethodArg.cxx:20
 TMethodArg.cxx:21
 TMethodArg.cxx:22
 TMethodArg.cxx:23
 TMethodArg.cxx:24
 TMethodArg.cxx:25
 TMethodArg.cxx:26
 TMethodArg.cxx:27
 TMethodArg.cxx:28
 TMethodArg.cxx:29
 TMethodArg.cxx:30
 TMethodArg.cxx:31
 TMethodArg.cxx:32
 TMethodArg.cxx:33
 TMethodArg.cxx:34
 TMethodArg.cxx:35
 TMethodArg.cxx:36
 TMethodArg.cxx:37
 TMethodArg.cxx:38
 TMethodArg.cxx:39
 TMethodArg.cxx:40
 TMethodArg.cxx:41
 TMethodArg.cxx:42
 TMethodArg.cxx:43
 TMethodArg.cxx:44
 TMethodArg.cxx:45
 TMethodArg.cxx:46
 TMethodArg.cxx:47
 TMethodArg.cxx:48
 TMethodArg.cxx:49
 TMethodArg.cxx:50
 TMethodArg.cxx:51
 TMethodArg.cxx:52
 TMethodArg.cxx:53
 TMethodArg.cxx:54
 TMethodArg.cxx:55
 TMethodArg.cxx:56
 TMethodArg.cxx:57
 TMethodArg.cxx:58
 TMethodArg.cxx:59
 TMethodArg.cxx:60
 TMethodArg.cxx:61
 TMethodArg.cxx:62
 TMethodArg.cxx:63
 TMethodArg.cxx:64
 TMethodArg.cxx:65
 TMethodArg.cxx:66
 TMethodArg.cxx:67
 TMethodArg.cxx:68
 TMethodArg.cxx:69
 TMethodArg.cxx:70
 TMethodArg.cxx:71
 TMethodArg.cxx:72
 TMethodArg.cxx:73
 TMethodArg.cxx:74
 TMethodArg.cxx:75
 TMethodArg.cxx:76
 TMethodArg.cxx:77
 TMethodArg.cxx:78
 TMethodArg.cxx:79
 TMethodArg.cxx:80
 TMethodArg.cxx:81
 TMethodArg.cxx:82
 TMethodArg.cxx:83
 TMethodArg.cxx:84
 TMethodArg.cxx:85
 TMethodArg.cxx:86
 TMethodArg.cxx:87
 TMethodArg.cxx:88
 TMethodArg.cxx:89
 TMethodArg.cxx:90
 TMethodArg.cxx:91
 TMethodArg.cxx:92
 TMethodArg.cxx:93
 TMethodArg.cxx:94
 TMethodArg.cxx:95
 TMethodArg.cxx:96
 TMethodArg.cxx:97
 TMethodArg.cxx:98
 TMethodArg.cxx:99
 TMethodArg.cxx:100
 TMethodArg.cxx:101
 TMethodArg.cxx:102
 TMethodArg.cxx:103
 TMethodArg.cxx:104
 TMethodArg.cxx:105
 TMethodArg.cxx:106
 TMethodArg.cxx:107
 TMethodArg.cxx:108
 TMethodArg.cxx:109
 TMethodArg.cxx:110
 TMethodArg.cxx:111
 TMethodArg.cxx:112
 TMethodArg.cxx:113
 TMethodArg.cxx:114
 TMethodArg.cxx:115