74 bool create_instance (
string file,
string classname, PyObject * args = NULL);
86 bool reload_instance (
string file,
string classname, PyObject * args = NULL);
101 PyObject *
call_method_ret (
const string &name, PyObject *args = NULL)
const;
109 void call_method (
const string & name, PyObject * args = NULL)
const
121 void run (PyObject * args = NULL)
247 bool instanciate (PyObject*,
string,
string, PyObject*);
252 std::string Classname;
257 std::string Filename;
260 #endif // PY_OBJECT_H
#define s_int32
32 bits long signed integer
PyObject * call_method_ret(const string &name, PyObject *args=NULL) const
Call a method of this object.
void call_method(const string &name, PyObject *args=NULL) const
Call a method of this object.
void clear()
Resets the script to it's post-constructor state.
py_object()
Default constructor.
string get_attribute_string(const string &name)
Returns the given attribute as string value.
void set_attribute(const string &name, PyObject *value)
Assign a new attribute to the module, overriding an existing attribute of the same name...
std::string class_name() const
Returns the class name of this object.
void set_attribute_int(const string &name, s_int32 value)
Assign a new integer attribute to the module, overriding an existing attribute of the same name...
bool create_instance(string file, string classname, PyObject *args=NULL)
Creates an instance of a Python class.
void run(PyObject *args=NULL)
Calls the run () method of this object.
PyObject * get_instance(const bool &incref=true) const
Direct access to the instance object.
PyObject * get_attribute(const string &name) const
Returns a new reference to an attribute of this object.
Defines the python class. This file is named this way so it doesn't conflicts with Python...
void set_attribute_string(const string &name, const string &value)
Assign a new string attribute to the module, overriding an existing attribute of the same name...
bool reload_instance(string file, string classname, PyObject *args=NULL)
Similar to create_instance, except that it will reload the module from disk, in case it has been chan...
PyObject * Instance
The python class instance wrapped by py_object.
s_int32 get_attribute_int(const string &name)
Returns the given attribute as integer value.
bool has_attribute(const std::string &name)
Tests whether the object contains a certain attribute (i.e.
std::string file_name() const
Returns the file name of this object.