library: libPyROOT #include "TPyReturn.h"

# TPyReturn

class description - source file - inheritance tree (.pdf)

## class TPyReturn

| Inheritance Chart:
`TPyReturn` |

        public:

                          TPyReturn()
                          TPyReturn(PyObject* pyobject)
                          TPyReturn(const TPyReturn&)
                  virtual ~TPyReturn()
           static TClass* Class()
          virtual TClass* IsA() const
                   Char_t operator Char_t() const
                    char* operator const char*() const
                 Double_t operator Double_t() const
                  Float_t operator Float_t() const
                    Int_t operator Int_t() const
                   Long_t operator Long_t() const
                  Short_t operator Short_t() const
                   UInt_t operator UInt_t() const
                  ULong_t operator ULong_t() const
                 UShort_t operator UShort_t() const
                    void* operator void*() const
               TPyReturn& operator=(const TPyReturn&)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)

### Data Members

        private:

          PyObject* fPyObject  ! actual python object

## Class Description

                            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()

     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()

     Destructor. Reference counting for the held python object is in effect.

### Inline Functions

             TPyReturn& operator=(const TPyReturn&)
                  char* operator const char*() const
                 Char_t operator Char_t() const
                 Long_t operator Long_t() const
                  Int_t operator Int_t() const
                Short_t operator Short_t() const
                ULong_t operator ULong_t() const
                 UInt_t operator UInt_t() const
               UShort_t operator UShort_t() const
               Double_t operator Double_t() const
                Float_t operator Float_t() const
                  void* operator void*() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)

Author: Wim Lavrijsen, May 2004
Last update: root/pyroot:$Name: $:$Id: TPyReturn.cxx,v 1.6 2005/06/25 04:25:46 brun Exp $