ROOT  6.06/08
Reference Guide
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
PyROOT::TMethodHolder Class Reference

Definition at line 20 of file TMethodHolder.h.

Public Member Functions

 TMethodHolder (Cppyy::TCppScope_t scope, Cppyy::TCppMethod_t method)
 
 TMethodHolder (const TMethodHolder &)
 
TMethodHolderoperator= (const TMethodHolder &)
 assignment operator More...
 
virtual ~TMethodHolder ()
 destructor More...
 
virtual PyObjectGetSignature ()
 
virtual PyObjectGetPrototype ()
 
virtual Int_t GetPriority ()
 Method priorities exist (in lieu of true overloading) there to prevent void* or <unknown>* from usurping otherwise valid calls. More...
 
virtual Int_t GetMaxArgs ()
 
virtual PyObjectGetCoVarNames ()
 Build a tuple of the argument types/names. More...
 
virtual PyObjectGetArgDefault (Int_t iarg)
 get the default value (if any) of argument iarg of this method More...
 
virtual PyObjectGetScopeProxy ()
 Get or build the scope of this method. More...
 
virtual PyCallableClone ()
 
virtual PyObjectCall (ObjectProxy *&self, PyObject *args, PyObject *kwds, TCallContext *ctxt=0)
 preliminary check in case keywords are accidently used (they are ignored otherwise) More...
 
virtual Bool_t Initialize (TCallContext *ctxt=0)
 done if cache is already setup More...
 
virtual PyObjectPreProcessArgs (ObjectProxy *&self, PyObject *args, PyObject *kwds)
 verify existence of self, return if ok More...
 
virtual Bool_t ConvertAndSetArgs (PyObject *args, TCallContext *ctxt=0)
 
virtual PyObjectExecute (void *self, ptrdiff_t offset, TCallContext *ctxt=0)
 call the interface method More...
 
- Public Member Functions inherited from PyROOT::PyCallable
virtual ~PyCallable ()
 
virtual PyObjectGetDocString ()
 

Protected Member Functions

Cppyy::TCppMethod_t GetMethod ()
 
Cppyy::TCppScope_t GetScope ()
 
TExecutorGetExecutor ()
 
std::string GetSignatureString ()
 built a signature representation (used for doc strings) More...
 
std::string GetReturnTypeName ()
 
virtual Bool_t InitExecutor_ (TExecutor *&, TCallContext *ctxt=0)
 install executor conform to the return type More...
 

Private Member Functions

void Copy_ (const TMethodHolder &)
 
void Destroy_ () const
 destroy executor and argument converters More...
 
PyObjectCallFast (void *, ptrdiff_t, TCallContext *)
 Helper code to prevent some duplication; this is called from CallSafe() as well as directly from TMethodHolder::Execute in fast mode. More...
 
PyObjectCallSafe (void *, ptrdiff_t, TCallContext *)
 Helper code to prevent some code duplication; this code embeds a ROOT "try/catch" block that saves the stack for restoration in case of an otherwise fatal signal. More...
 
Bool_t InitConverters_ ()
 build buffers for argument dispatching More...
 
void SetPyError_ (PyObject *msg)
 helper to report errors in a consistent format (derefs msg) More...
 

Private Attributes

Cppyy::TCppMethod_t fMethod
 
Cppyy::TCppScope_t fScope
 
TExecutorfExecutor
 
std::vector< TConverter *> fConverters
 
Int_t fArgsRequired
 
Bool_t fIsInitialized
 

#include </builddir/build/BUILD/root-6.06.08/bindings/pyroot/src/TMethodHolder.h>

+ Inheritance diagram for PyROOT::TMethodHolder:
+ Collaboration diagram for PyROOT::TMethodHolder:

Constructor & Destructor Documentation

§ TMethodHolder() [1/2]

PyROOT::TMethodHolder::TMethodHolder ( Cppyy::TCppScope_t  scope,
Cppyy::TCppMethod_t  method 
)

Definition at line 242 of file TMethodHolder.cxx.

Referenced by Clone().

§ TMethodHolder() [2/2]

PyROOT::TMethodHolder::TMethodHolder ( const TMethodHolder other)

Definition at line 250 of file TMethodHolder.cxx.

§ ~TMethodHolder()

PyROOT::TMethodHolder::~TMethodHolder ( )
virtual

destructor

Definition at line 275 of file TMethodHolder.cxx.

Member Function Documentation

§ Call()

PyObject * PyROOT::TMethodHolder::Call ( ObjectProxy *&  self,
PyObject args,
PyObject kwds,
TCallContext ctxt = 0 
)
virtual

preliminary check in case keywords are accidently used (they are ignored otherwise)

Implements PyROOT::PyCallable.

Reimplemented in PyROOT::TConstructorHolder, PyROOT::TFunctionHolder, and PyROOT::TClassMethodHolder.

Definition at line 540 of file TMethodHolder.cxx.

Referenced by Clone().

§ CallFast()

PyObject * PyROOT::TMethodHolder::CallFast ( void self,
ptrdiff_t  offset,
TCallContext ctxt 
)
inlineprivate

Helper code to prevent some duplication; this is called from CallSafe() as well as directly from TMethodHolder::Execute in fast mode.

Definition at line 63 of file TMethodHolder.cxx.

Referenced by Execute(), and GetExecutor().

§ CallSafe()

PyObject * PyROOT::TMethodHolder::CallSafe ( void self,
ptrdiff_t  offset,
TCallContext ctxt 
)
inlineprivate

Helper code to prevent some code duplication; this code embeds a ROOT "try/catch" block that saves the stack for restoration in case of an otherwise fatal signal.

Definition at line 112 of file TMethodHolder.cxx.

Referenced by Execute(), and GetExecutor().

§ Clone()

virtual PyCallable* PyROOT::TMethodHolder::Clone ( )
inlinevirtual

§ ConvertAndSetArgs()

Bool_t PyROOT::TMethodHolder::ConvertAndSetArgs ( PyObject args,
TCallContext ctxt = 0 
)
virtual

§ Copy_()

void PyROOT::TMethodHolder::Copy_ ( const TMethodHolder )
inlineprivate

Definition at line 36 of file TMethodHolder.cxx.

Referenced by GetExecutor(), operator=(), and TMethodHolder().

§ Destroy_()

void PyROOT::TMethodHolder::Destroy_ ( ) const
inlineprivate

destroy executor and argument converters

Definition at line 51 of file TMethodHolder.cxx.

Referenced by GetExecutor(), operator=(), and ~TMethodHolder().

§ Execute()

PyObject * PyROOT::TMethodHolder::Execute ( void self,
ptrdiff_t  offset,
TCallContext ctxt = 0 
)
virtual

§ GetArgDefault()

PyObject * PyROOT::TMethodHolder::GetArgDefault ( Int_t  iarg)
virtual

get the default value (if any) of argument iarg of this method

Implements PyROOT::PyCallable.

Definition at line 391 of file TMethodHolder.cxx.

§ GetCoVarNames()

PyObject * PyROOT::TMethodHolder::GetCoVarNames ( )
virtual

Build a tuple of the argument types/names.

Implements PyROOT::PyCallable.

Definition at line 364 of file TMethodHolder.cxx.

§ GetExecutor()

TExecutor* PyROOT::TMethodHolder::GetExecutor ( )
inlineprotected

Definition at line 51 of file TMethodHolder.h.

Referenced by PyROOT::TSetItemHolder::PreProcessArgs().

§ GetMaxArgs()

Int_t PyROOT::TMethodHolder::GetMaxArgs ( )
virtual

Implements PyROOT::PyCallable.

Definition at line 356 of file TMethodHolder.cxx.

Referenced by GetArgDefault(), and GetCoVarNames().

§ GetMethod()

Cppyy::TCppMethod_t PyROOT::TMethodHolder::GetMethod ( )
inlineprotected

Definition at line 49 of file TMethodHolder.h.

Referenced by PyROOT::TConstructorHolder::GetDocString().

§ GetPriority()

Int_t PyROOT::TMethodHolder::GetPriority ( )
virtual

Method priorities exist (in lieu of true overloading) there to prevent void* or <unknown>* from usurping otherwise valid calls.

TODO: extend this to favour classes that are not bases.

Implements PyROOT::PyCallable.

Definition at line 297 of file TMethodHolder.cxx.

§ GetPrototype()

PyObject * PyROOT::TMethodHolder::GetPrototype ( )
virtual

Implements PyROOT::PyCallable.

Definition at line 282 of file TMethodHolder.cxx.

§ GetReturnTypeName()

std::string PyROOT::TMethodHolder::GetReturnTypeName ( )
protected

Definition at line 603 of file TMethodHolder.cxx.

Referenced by GetExecutor(), and PyROOT::TSetItemHolder::InitExecutor_().

§ GetScope()

Cppyy::TCppScope_t PyROOT::TMethodHolder::GetScope ( )
inlineprotected

§ GetScopeProxy()

PyObject * PyROOT::TMethodHolder::GetScopeProxy ( )
virtual

Get or build the scope of this method.

Implements PyROOT::PyCallable.

Definition at line 416 of file TMethodHolder.cxx.

§ GetSignature()

PyObject * PyROOT::TMethodHolder::GetSignature ( )
virtual

Implements PyROOT::PyCallable.

Definition at line 595 of file TMethodHolder.cxx.

§ GetSignatureString()

std::string PyROOT::TMethodHolder::GetSignatureString ( )
protected

built a signature representation (used for doc strings)

Definition at line 181 of file TMethodHolder.cxx.

Referenced by PyROOT::TConstructorHolder::GetDocString(), GetExecutor(), GetPrototype(), and GetSignature().

§ InitConverters_()

Bool_t PyROOT::TMethodHolder::InitConverters_ ( )
private

build buffers for argument dispatching

Definition at line 130 of file TMethodHolder.cxx.

Referenced by GetExecutor(), and Initialize().

§ InitExecutor_()

Bool_t PyROOT::TMethodHolder::InitExecutor_ ( TExecutor *&  executor,
TCallContext ctxt = 0 
)
protectedvirtual

install executor conform to the return type

Reimplemented in PyROOT::TConstructorHolder, and PyROOT::TSetItemHolder.

Definition at line 166 of file TMethodHolder.cxx.

Referenced by GetExecutor(), PyROOT::TSetItemHolder::InitExecutor_(), and Initialize().

§ Initialize()

Bool_t PyROOT::TMethodHolder::Initialize ( TCallContext ctxt = 0)
virtual

done if cache is already setup

Definition at line 424 of file TMethodHolder.cxx.

Referenced by PyROOT::TClassMethodHolder::Call(), PyROOT::TFunctionHolder::Call(), PyROOT::TConstructorHolder::Call(), Call(), and Clone().

§ operator=()

PyROOT::TMethodHolder & PyROOT::TMethodHolder::operator= ( const TMethodHolder other)

assignment operator

Definition at line 260 of file TMethodHolder.cxx.

§ PreProcessArgs()

PyObject * PyROOT::TMethodHolder::PreProcessArgs ( ObjectProxy *&  self,
PyObject args,
PyObject kwds 
)
virtual

verify existence of self, return if ok

Reimplemented in PyROOT::TSetItemHolder, and PyROOT::TFunctionHolder.

Definition at line 447 of file TMethodHolder.cxx.

Referenced by PyROOT::TConstructorHolder::Call(), Call(), Clone(), and PyROOT::TSetItemHolder::PreProcessArgs().

§ SetPyError_()

void PyROOT::TMethodHolder::SetPyError_ ( PyObject msg)
private

helper to report errors in a consistent format (derefs msg)

Definition at line 207 of file TMethodHolder.cxx.

Referenced by ConvertAndSetArgs(), Execute(), GetExecutor(), and PreProcessArgs().

Member Data Documentation

§ fArgsRequired

Int_t PyROOT::TMethodHolder::fArgsRequired
private

Definition at line 78 of file TMethodHolder.h.

Referenced by ConvertAndSetArgs(), and Initialize().

§ fConverters

std::vector< TConverter* > PyROOT::TMethodHolder::fConverters
private

Definition at line 75 of file TMethodHolder.h.

Referenced by ConvertAndSetArgs().

§ fExecutor

TExecutor* PyROOT::TMethodHolder::fExecutor
private

Definition at line 72 of file TMethodHolder.h.

Referenced by GetExecutor(), and Initialize().

§ fIsInitialized

Bool_t PyROOT::TMethodHolder::fIsInitialized
private

Definition at line 81 of file TMethodHolder.h.

Referenced by Initialize().

§ fMethod

Cppyy::TCppMethod_t PyROOT::TMethodHolder::fMethod
private

§ fScope

Cppyy::TCppScope_t PyROOT::TMethodHolder::fScope
private

Definition at line 71 of file TMethodHolder.h.

Referenced by Call(), GetPrototype(), GetScope(), GetScopeProxy(), operator=(), and PreProcessArgs().


The documentation for this class was generated from the following files: