library: libPyROOT #include "TPyReturn.h" |
TPyReturn
class description - header file - source file
viewCVS header - viewCVS source
class TPyReturn
Function Members (Methods)
Display options:
Data Members
private:
PyObject* | fPyObject | ! actual python object |
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
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()
Destructor. Reference counting for the held python object is in effect.
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).
Author: Wim Lavrijsen, May 2004
Last update: root/pyroot:$Name: $:$Id: TPyReturn.cxx,v 1.7 2006/07/01 21:19:55 brun Exp $
ROOT page - Class index - Class Hierarchy - Top of the page
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.