class TPyReturn

                        Python expression eval result


 Transport class for bringing objects from python (dynamically typed) to CINT
 (statically typed). It is best to immediately cast a TPyReturn to the real
 type, either implicitly (for builtin types) or explicitly (through a void*
 cast for pointers to ROOT objects).

 Examples:

  root [0] TBrowser* b = (void*)TPython::Eval( "ROOT.TBrowser()" );
  root [1] int i = TPython::Eval( "1+1" );
  root [2] i
  (int)2
  root [3] double d = TPython::Eval( "1+3.1415" );
  root [4] d
  (double)4.14150000000000063e+00

Function Members (Methods)

public:
TPyReturn()
TPyReturn(PyObject* pyobject)
TPyReturn(const TPyReturn&)
virtual~TPyReturn()
static TClass*Class()
virtual TClass*IsA() const
PyObject*operator _object*() const
Char_toperator Char_t() const
const char*operator const char*() const
Double_toperator Double_t() const
Float_toperator Float_t() const
Int_toperator Int_t() const
Long_toperator Long_t() const
Short_toperator Short_t() const
UInt_toperator UInt_t() const
ULong_toperator ULong_t() const
UShort_toperator UShort_t() const
void*operator void*() const
TPyReturn&operator=(const TPyReturn&)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& b)

Data Members

private:
PyObject*fPyObject! actual python object

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TPyReturn()
 Construct a TPyReturn object from Py_None.
TPyReturn( PyObject* pyobject )
 Construct a TPyReturn from a python object. The python object may represent
 a ROOT object. Steals reference to given python object.
TPyReturn( const TPyReturn& other )
 Copy constructor. Applies python object reference counting.
TPyReturn& operator=(const TPyReturn& )
 Assignment operator. Applies python object reference counting.
~TPyReturn()
 Destructor. Reference counting for the held python object is in effect.
operator const char*()
 Cast python return value to C-style string (may fail).
operator Char_t()
 Cast python return value to C++ char (may fail).
operator Long_t()
 Cast python return value to C++ long (may fail).
operator ULong_t()
 Cast python return value to C++ unsigned long (may fail).
operator Double_t()
 Cast python return value to to C++ double (may fail).
operator void*()
 Cast python return value to ROOT object with dictionary (may fail; note that
 you have to use the void* converter, as CINT will not call any other).
operator Int_t()
{ return (Int_t)operator Long_t(); }
operator Short_t()
{ return (Short_t)operator Long_t(); }
operator UInt_t()
{ return (UInt_t)operator ULong_t(); }
operator UShort_t()
{ return (UShort_t)operator ULong_t(); }
operator Float_t()
{ return (Float_t)operator Double_t(); }

Author: Wim Lavrijsen May 2004
Last change: root/pyroot:$Id: TPyReturn.h 22698 2008-03-18 01:02:02Z wlav $
Last generated: 2008-06-25 08:51

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.