Kross::Python::PythonObject Class Reference

#include <pythonobject.h>

Inheritance diagram for Kross::Python::PythonObject:
Kross::Api::Object

Public Member Functions

 PythonObject (const Py::Object &object)
 
virtual ~PythonObject ()
 
virtual const TQString getClassName () const
 
virtual Kross::Api::Object::Ptr call (const TQString &name, Kross::Api::List::Ptr arguments)
 
virtual TQStringList getCalls ()
 
- Public Member Functions inherited from Kross::Api::Object
 Object ()
 
virtual ~Object ()
 
virtual const TQString toString ()
 
virtual Object::Ptr call (const TQString &name, TDESharedPtr< List > arguments)
 

Additional Inherited Members

- Public Types inherited from Kross::Api::Object
typedef TDESharedPtr< Object > Ptr
 
- Static Public Member Functions inherited from Kross::Api::Object
template<class T >
static T * fromObject (Object::Ptr object)
 
template<typename TYPE >
static Object::Ptr toObject (TYPE t)
 

Detailed Description

The PythonObject class is used for Instances of Python Classes by the PythonExtension class.

Definition at line 37 of file pythonobject.h.

Constructor & Destructor Documentation

◆ PythonObject()

PythonObject::PythonObject ( const Py::Object &  object)
explicit

Constructor.

Parameters
objectThe Py::Object this PythonObject provides access to.

Definition at line 25 of file pythonobject.cpp.

◆ ~PythonObject()

PythonObject::~PythonObject ( )
virtual

Destructor.

Definition at line 56 of file pythonobject.cpp.

Member Function Documentation

◆ call()

Kross::Api::Object::Ptr PythonObject::call ( const TQString &  name,
Kross::Api::List::Ptr  arguments 
)
virtual

Pass a call to the object.

Objects like Class are able to handle call's by just implementating this function.

Exceptions
TypeExceptionif the object or the name is not callable.
Parameters
nameEach call has a name that says what should be called. In the case of a Class the name is the functionname.
argumentsThe list of arguments passed to the call.
Returns
The call-result as Object* instance or NULL if the call has no result.

Definition at line 65 of file pythonobject.cpp.

◆ getCalls()

TQStringList PythonObject::getCalls ( )
virtual

Return a list of supported callable objects.

Returns
List of supported calls.

Reimplemented from Kross::Api::Object.

Definition at line 90 of file pythonobject.cpp.

◆ getClassName()

const TQString PythonObject::getClassName ( ) const
virtual

Return the class name.

This could be something like "Kross::Python::PythonObject" for this object. The value is mainly used for display purposes.

Returns
The name of this class.

Implements Kross::Api::Object.

Definition at line 60 of file pythonobject.cpp.


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