Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
cppjit::cpyrt::CPPFunction Class Reference

Definition at line 10 of file CPPFunction.h.

Public Member Functions

PyObject * Call (CPPInstance *&self, cpyrt_PyArgs_t args, size_t nargsf, PyObject *kwds, CallContext *ctxt=nullptr) override
 
PyCallable * Clone () override
 
 CPPMethod (const CPPMethod &)
 
 CPPMethod (interop::TCppScope_t scope, interop::TCppMethod_t method)
 
PyObject * GetArgDefault (int iarg, bool silent=true) override
 
int GetArgMatchScore (PyObject *args_tuple) override
 
PyObject * GetCoVarNames () override
 
virtual PyObject * GetDocString ()
 
interop::TCppFuncAddr_t GetFunctionAddress () override
 
int GetMaxArgs () override
 
int GetPriority () override
 
PyObject * GetPrototype (bool show_formalargs=true) override
 Construct a Python string from the method's prototype.
 
PyObject * GetScopeProxy () override
 
PyObject * GetSignature (bool show_formalargs=true) override
 
PyObject * GetSignatureNames () override
 Returns a tuple with the names of the input parameters of this method.
 
PyObject * GetSignatureTypes () override
 Returns a dictionary with the types of the signature of this method.
 
PyObject * GetTypeName () override
 
bool IsConst () override
 
bool IsGreedy () override
 
bool IsSimilarFnType (cppjit::interop::TCppType_t fn_type) override
 
PyObject * Reflex (interop::Reflex::RequestId_t request, interop::Reflex::FormatId_t=interop::Reflex::OPTIMAL) override
 

Protected Member Functions

bool ConvertAndSetArgs (cpyrt_PyArgs_t, size_t nargsf, CallContext *ctxt=nullptr)
 
PyObject * Execute (void *self, ptrdiff_t offset, CallContext *ctxt=nullptr)
 
Executor * GetExecutor ()
 
interop::TCppMethod_t GetMethod ()
 
std::string GetReturnTypeName ()
 
interop::TCppScope_t GetScope ()
 
std::string GetSignatureString (bool show_formalargs=true)
 
virtual bool InitExecutor_ (Executor *&, CallContext *ctxt=nullptr)
 
bool Initialize (CallContext *ctxt=nullptr)
 
bool ProcessArgs (PyCallArgs &args) override
 
bool ProcessKwds (PyObject *self_in, PyCallArgs &args)
 
virtual bool ResultIsPyObject () const
 

Protected Attributes

int fArgsRequired
 

Private Member Functions

void Copy_ (const CPPMethod &)
 
void Destroy_ ()
 
PyObject * ExecuteFast (void *, ptrdiff_t, CallContext *)
 
bool InitConverters_ ()
 
void SetPyError_ (PyObject *msg)
 
bool VerifyArgCount_ (Py_ssize_t)
 

Private Attributes

std::unordered_map< std::string, int > * fArgIndices
 
std::vector< Converter * > fConverters
 
Executor * fExecutor
 
interop::TCppMethod_t fMethod
 
interop::TCppScope_t fScope
 

#include </github/home/ROOT-CI/src/bindings/pyroot/cppjit/src/cpyrt/CPPFunction.h>

Inheritance diagram for cppjit::cpyrt::CPPFunction:
[legend]

Member Function Documentation

◆ Call()

PyObject * cpyrt::CPPFunction::Call ( CPPInstance *& self,
cpyrt_PyArgs_t args,
size_t nargsf,
PyObject * kwds,
CallContext * ctxt = nullptr )
overridevirtual

Implements cppjit::cpyrt::PyCallable.

Reimplemented in cppjit::cpyrt::CPPReverseBinary.

Definition at line 47 of file CPPFunction.cxx.

◆ Clone()

PyCallable * cppjit::cpyrt::CPPFunction::Clone ( )
inlineoverridevirtual

Implements cppjit::cpyrt::PyCallable.

Reimplemented in cppjit::cpyrt::CPPReverseBinary.

Definition at line 18 of file CPPFunction.h.

◆ ConvertAndSetArgs()

bool cpyrt::CPPMethod::ConvertAndSetArgs ( cpyrt_PyArgs_t args,
size_t nargsf,
CallContext * ctxt = nullptr )
protectedinherited

Definition at line 936 of file CPPMethod.cxx.

◆ Copy_()

void cpyrt::CPPMethod::Copy_ ( const CPPMethod & )
inlineprivateinherited

Definition at line 80 of file CPPMethod.cxx.

◆ CPPMethod() [1/2]

cpyrt::CPPMethod::CPPMethod ( const CPPMethod & other)

Definition at line 44 of file CPPMethod.cxx.

◆ CPPMethod() [2/2]

cpyrt::CPPMethod::CPPMethod ( interop::TCppScope_t scope,
interop::TCppMethod_t method )

Definition at line 43 of file CPPMethod.cxx.

◆ Destroy_()

void cpyrt::CPPMethod::Destroy_ ( )
inlineprivateinherited

Definition at line 90 of file CPPMethod.cxx.

◆ Execute()

PyObject * cpyrt::CPPMethod::Execute ( void * self,
ptrdiff_t offset,
CallContext * ctxt = nullptr )
protectedinherited

Definition at line 966 of file CPPMethod.cxx.

◆ ExecuteFast()

PyObject * cpyrt::CPPMethod::ExecuteFast ( void * self,
ptrdiff_t offset,
CallContext * ctxt )
inlineprivateinherited

Definition at line 108 of file CPPMethod.cxx.

◆ GetArgDefault()

PyObject * cpyrt::CPPMethod::GetArgDefault ( int iarg,
bool silent = true )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 616 of file CPPMethod.cxx.

◆ GetArgMatchScore()

int cpyrt::CPPMethod::GetArgMatchScore ( PyObject * args_tuple)
overridevirtualinherited

Reimplemented from cppjit::cpyrt::PyCallable.

Definition at line 720 of file CPPMethod.cxx.

◆ GetCoVarNames()

PyObject * cpyrt::CPPMethod::GetCoVarNames ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 593 of file CPPMethod.cxx.

◆ GetDocString()

virtual PyObject * cppjit::cpyrt::PyCallable::GetDocString ( )
inlinevirtualinherited

Reimplemented in cppjit::cpyrt::CPPConstructor.

Definition at line 25 of file PyCallable.h.

◆ GetExecutor()

Executor * cppjit::cpyrt::CPPMethod::GetExecutor ( )
inlineprotectedinherited

Definition at line 94 of file CPPMethod.h.

◆ GetFunctionAddress()

interop::TCppFuncAddr_t cpyrt::CPPMethod::GetFunctionAddress ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 713 of file CPPMethod.cxx.

◆ GetMaxArgs()

int cpyrt::CPPMethod::GetMaxArgs ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 588 of file CPPMethod.cxx.

◆ GetMethod()

interop::TCppMethod_t cppjit::cpyrt::CPPMethod::GetMethod ( )
inlineprotectedinherited

Definition at line 92 of file CPPMethod.h.

◆ GetPriority()

int cpyrt::CPPMethod::GetPriority ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 450 of file CPPMethod.cxx.

◆ GetPrototype()

PyObject * cpyrt::CPPMethod::GetPrototype ( bool fa = true)
overridevirtualinherited

Construct a Python string from the method's prototype.

Parameters
faShow formal arguments of the method
Returns
PyObject* A Python string with the full method prototype, namespaces included.

For example, given:

int foo(int x);

namespace a { namespace b { namespace c { int foo(int x); }}}

This function returns:

'int foo(int x)' 'int a::b::c::foo(int x)'

Implements cppjit::cpyrt::PyCallable.

Definition at line 398 of file CPPMethod.cxx.

◆ GetReturnTypeName()

std::string cpyrt::CPPMethod::GetReturnTypeName ( )
protectedinherited

Definition at line 1120 of file CPPMethod.cxx.

◆ GetScope()

interop::TCppScope_t cppjit::cpyrt::CPPMethod::GetScope ( )
inlineprotectedinherited

Definition at line 93 of file CPPMethod.h.

◆ GetScopeProxy()

PyObject * cpyrt::CPPMethod::GetScopeProxy ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 707 of file CPPMethod.cxx.

◆ GetSignature()

PyObject * cpyrt::CPPMethod::GetSignature ( bool show_formalargs = true)
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 1044 of file CPPMethod.cxx.

◆ GetSignatureNames()

PyObject * cpyrt::CPPMethod::GetSignatureNames ( )
overridevirtualinherited

Returns a tuple with the names of the input parameters of this method.

For example given a function with prototype:

double foo(int a, float b, double c)

this function returns:

('a', 'b', 'c')

Implements cppjit::cpyrt::PyCallable.

Definition at line 1060 of file CPPMethod.cxx.

◆ GetSignatureString()

std::string cpyrt::CPPMethod::GetSignatureString ( bool show_formalargs = true)
protectedinherited

Definition at line 233 of file CPPMethod.cxx.

◆ GetSignatureTypes()

PyObject * cpyrt::CPPMethod::GetSignatureTypes ( )
overridevirtualinherited

Returns a dictionary with the types of the signature of this method.

This dictionary will store both the return type and the input parameter types of this method, respectively with keys "return_type" and "input_types", for example given a function with prototype:

double foo(int a, float b, double c)

this function returns:

{'input_types': ('int', 'float', 'double'), 'return_type': 'double'}

Implements cppjit::cpyrt::PyCallable.

Definition at line 1087 of file CPPMethod.cxx.

◆ GetTypeName()

PyObject * cpyrt::CPPFunction::GetTypeName ( )
overridevirtual

Reimplemented from cppjit::cpyrt::PyCallable.

Definition at line 90 of file CPPFunction.cxx.

◆ InitConverters_()

bool cpyrt::CPPMethod::InitConverters_ ( )
privateinherited

Definition at line 197 of file CPPMethod.cxx.

◆ InitExecutor_()

bool cpyrt::CPPMethod::InitExecutor_ ( Executor *& executor,
CallContext * ctxt = nullptr )
protectedvirtualinherited

Reimplemented in cppjit::cpyrt::CPPConstructor, and cppjit::cpyrt::CPPSetItem.

Definition at line 219 of file CPPMethod.cxx.

◆ Initialize()

bool cpyrt::CPPMethod::Initialize ( CallContext * ctxt = nullptr)
protectedinherited

Definition at line 754 of file CPPMethod.cxx.

◆ IsConst()

bool cpyrt::CPPMethod::IsConst ( )
overridevirtualinherited

Reimplemented from cppjit::cpyrt::PyCallable.

Definition at line 704 of file CPPMethod.cxx.

◆ IsGreedy()

bool cpyrt::CPPMethod::IsGreedy ( )
overridevirtualinherited

Implements cppjit::cpyrt::PyCallable.

Definition at line 570 of file CPPMethod.cxx.

◆ IsSimilarFnType()

bool cppjit::cpyrt::CPPMethod::IsSimilarFnType ( cppjit::interop::TCppType_t fn_type)
inlineoverridevirtualinherited

Reimplemented from cppjit::cpyrt::PyCallable.

Definition at line 73 of file CPPMethod.h.

◆ ProcessArgs()

bool cpyrt::CPPFunction::ProcessArgs ( PyCallArgs & args)
overrideprotectedvirtual

Reimplemented from cppjit::cpyrt::CPPMethod.

Reimplemented in cppjit::cpyrt::CPPReverseBinary.

Definition at line 38 of file CPPFunction.cxx.

◆ ProcessKwds()

bool cpyrt::CPPMethod::ProcessKwds ( PyObject * self_in,
PyCallArgs & args )
protectedinherited

Definition at line 773 of file CPPMethod.cxx.

◆ Reflex()

PyObject * cpyrt::CPPMethod::Reflex ( interop::Reflex::RequestId_t request,
interop::Reflex::FormatId_t format = interop::Reflex::OPTIMAL )
overridevirtualinherited

Reimplemented from cppjit::cpyrt::PyCallable.

Definition at line 424 of file CPPMethod.cxx.

◆ ResultIsPyObject()

virtual bool cppjit::cpyrt::CPPMethod::ResultIsPyObject ( ) const
inlineprotectedvirtualinherited

Reimplemented in cppjit::cpyrt::CPPConstructor.

Definition at line 102 of file CPPMethod.h.

◆ SetPyError_()

void cpyrt::CPPMethod::SetPyError_ ( PyObject * msg)
privateinherited

Definition at line 239 of file CPPMethod.cxx.

◆ VerifyArgCount_()

bool cpyrt::CPPMethod::VerifyArgCount_ ( Py_ssize_t actual)
inlineprivateinherited

Definition at line 61 of file CPPMethod.cxx.

Member Data Documentation

◆ fArgIndices

std::unordered_map<std::string, int>* cppjit::cpyrt::CPPMethod::fArgIndices
privateinherited

Definition at line 123 of file CPPMethod.h.

◆ fArgsRequired

int cppjit::cpyrt::CPPMethod::fArgsRequired
protectedinherited

Definition at line 127 of file CPPMethod.h.

◆ fConverters

std::vector<Converter*> cppjit::cpyrt::CPPMethod::fConverters
privateinherited

Definition at line 122 of file CPPMethod.h.

◆ fExecutor

Executor* cppjit::cpyrt::CPPMethod::fExecutor
privateinherited

Definition at line 119 of file CPPMethod.h.

◆ fMethod

interop::TCppMethod_t cppjit::cpyrt::CPPMethod::fMethod
privateinherited

Definition at line 117 of file CPPMethod.h.

◆ fScope

interop::TCppScope_t cppjit::cpyrt::CPPMethod::fScope
privateinherited

Definition at line 118 of file CPPMethod.h.

  • bindings/pyroot/cppjit/src/cpyrt/CPPFunction.h
  • bindings/pyroot/cppjit/src/cpyrt/CPPFunction.cxx