Lean  $LEAN_TAG$
QuantConnect.Python.BasePythonWrapper< TInterface > Class Template Reference

Base class for Python wrapper classes More...

Public Member Functions

 BasePythonWrapper (bool validateInterface=true)
 Creates a new instance of the BasePythonWrapper<TInterface> class More...
 
 BasePythonWrapper (PyObject instance, bool validateInterface=true)
 Creates a new instance of the BasePythonWrapper<TInterface> class with the specified instance More...
 
void SetPythonInstance (PyObject instance)
 Sets the python instance More...
 
GetProperty< T > (string propertyName)
 Gets the Python instance property with the specified name More...
 
PyObject GetProperty (string propertyName)
 Gets the Python instance property with the specified name More...
 
void SetProperty (string propertyName, object value)
 Sets the Python instance property with the specified name More...
 
dynamic GetEvent (string name)
 Gets the Python instance event with the specified name More...
 
bool HasAttr (string name)
 Determines whether the Python instance has the specified attribute More...
 
PyObject GetMethod (string methodName)
 Gets the Python instances method with the specified name and caches it More...
 
InvokeMethod< T > (string methodName, params object[] args)
 Invokes the specified method with the specified arguments More...
 
PyObject InvokeMethod (string methodName, params object[] args)
 Invokes the specified method with the specified arguments More...
 

Protected Attributes

PyObject Instance => _instance
 Gets the underlying python instance More...
 

Detailed Description

Base class for Python wrapper classes

Definition at line 24 of file BasePythonWrapper.cs.

Constructor & Destructor Documentation

◆ BasePythonWrapper() [1/2]

QuantConnect.Python.BasePythonWrapper< TInterface >.BasePythonWrapper ( bool  validateInterface = true)

Creates a new instance of the BasePythonWrapper<TInterface> class

Parameters
validateInterfaceWhether to perform validations for interface implementation

Definition at line 42 of file BasePythonWrapper.cs.

◆ BasePythonWrapper() [2/2]

QuantConnect.Python.BasePythonWrapper< TInterface >.BasePythonWrapper ( PyObject  instance,
bool  validateInterface = true 
)

Creates a new instance of the BasePythonWrapper<TInterface> class with the specified instance

Parameters
instanceThe underlying python instance
validateInterfaceWhether to perform validations for interface implementation

Definition at line 54 of file BasePythonWrapper.cs.

Member Function Documentation

◆ SetPythonInstance()

void QuantConnect.Python.BasePythonWrapper< TInterface >.SetPythonInstance ( PyObject  instance)

Sets the python instance

Parameters
instanceThe underlying python instance

Definition at line 64 of file BasePythonWrapper.cs.

Here is the caller graph for this function:

◆ GetProperty< T >()

T QuantConnect.Python.BasePythonWrapper< TInterface >.GetProperty< T > ( string  propertyName)

Gets the Python instance property with the specified name

Parameters
propertyNameThe name of the property

Definition at line 80 of file BasePythonWrapper.cs.

◆ GetProperty()

PyObject QuantConnect.Python.BasePythonWrapper< TInterface >.GetProperty ( string  propertyName)

Gets the Python instance property with the specified name

Parameters
propertyNameThe name of the property

Definition at line 90 of file BasePythonWrapper.cs.

Here is the caller graph for this function:

◆ SetProperty()

void QuantConnect.Python.BasePythonWrapper< TInterface >.SetProperty ( string  propertyName,
object  value 
)

Sets the Python instance property with the specified name

Parameters
propertyNameThe name of the property
valueThe property value

Definition at line 101 of file BasePythonWrapper.cs.

◆ GetEvent()

dynamic QuantConnect.Python.BasePythonWrapper< TInterface >.GetEvent ( string  name)

Gets the Python instance event with the specified name

Parameters
nameThe name of the event

Definition at line 111 of file BasePythonWrapper.cs.

◆ HasAttr()

bool QuantConnect.Python.BasePythonWrapper< TInterface >.HasAttr ( string  name)

Determines whether the Python instance has the specified attribute

Parameters
nameThe attribute name
Returns
Whether the Python instance has the specified attribute

Definition at line 122 of file BasePythonWrapper.cs.

Here is the caller graph for this function:

◆ GetMethod()

PyObject QuantConnect.Python.BasePythonWrapper< TInterface >.GetMethod ( string  methodName)

Gets the Python instances method with the specified name and caches it

Parameters
methodNameThe name of the method
Returns
The matched method

Definition at line 133 of file BasePythonWrapper.cs.

Here is the caller graph for this function:

◆ InvokeMethod< T >()

T QuantConnect.Python.BasePythonWrapper< TInterface >.InvokeMethod< T > ( string  methodName,
params object[]  args 
)

Invokes the specified method with the specified arguments

Parameters
methodNameThe name of the method
argsThe arguments to call the method with
Returns
The returned valued converted to the given type

Definition at line 150 of file BasePythonWrapper.cs.

◆ InvokeMethod()

PyObject QuantConnect.Python.BasePythonWrapper< TInterface >.InvokeMethod ( string  methodName,
params object[]  args 
)

Invokes the specified method with the specified arguments

Parameters
methodNameThe name of the method
argsThe arguments to call the method with

Definition at line 162 of file BasePythonWrapper.cs.

Here is the caller graph for this function:

Member Data Documentation

◆ Instance

PyObject QuantConnect.Python.BasePythonWrapper< TInterface >.Instance => _instance
protected

Gets the underlying python instance

Definition at line 36 of file BasePythonWrapper.cs.


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