Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TPyArg.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Author: Enric Tejedor CERN  08/2019
0002 // Original PyROOT code by Wim Lavrijsen, LBL
0003 //
0004 // /*************************************************************************
0005 //  * Copyright (C) 1995-2019, Rene Brun and Fons Rademakers.               *
0006 //  * All rights reserved.                                                  *
0007 //  *                                                                       *
0008 //  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009 //  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010 //  *************************************************************************/
0011 
0012 #ifndef ROOT_TPyArg
0013 #define ROOT_TPyArg
0014 
0015 //////////////////////////////////////////////////////////////////////////////
0016 //                                                                          //
0017 // TPyArg                                                                   //
0018 //                                                                          //
0019 // Morphing argument type from evaluating python expressions.               //
0020 //                                                                          //
0021 //////////////////////////////////////////////////////////////////////////////
0022 
0023 // ROOT
0024 #include "Rtypes.h"
0025 
0026 // Python
0027 struct _object;
0028 typedef _object PyObject;
0029 
0030 // Standard
0031 #include <vector>
0032 
0033 class TPyArg {
0034 public:
0035    // converting constructors
0036    TPyArg(PyObject *);
0037    TPyArg(Int_t);
0038    TPyArg(Long_t);
0039    TPyArg(Double_t);
0040    TPyArg(const char *);
0041 
0042    TPyArg(const TPyArg &);
0043    TPyArg &operator=(const TPyArg &);
0044    virtual ~TPyArg();
0045 
0046    // "extractor"
0047    operator PyObject *() const;
0048 
0049    // constructor and generic dispatch
0050    static void CallConstructor(PyObject *&pyself, PyObject *pyclass, const std::vector<TPyArg> &args);
0051    static void CallConstructor(PyObject *&pyself, PyObject *pyclass); // default ctor
0052    static PyObject *CallMethod(PyObject *pymeth, const std::vector<TPyArg> &args);
0053    static void CallDestructor(PyObject *&pyself, PyObject *pymeth, const std::vector<TPyArg> &args);
0054    static void CallDestructor(PyObject *&pyself);
0055 
0056    ClassDef(TPyArg, 1) // Python morphing argument type
0057 
0058 private:
0059    mutable PyObject *fPyObject; //! converted C++ value as python object
0060 };
0061 
0062 #endif