Add address getter method to Python wrapper
This commit is contained in:
@@ -14,50 +14,47 @@
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
class SwigDirector_PythonDirectorCallbackClass
|
||||
: public PythonDirectorCallbackClass
|
||||
, public Swig::Director {
|
||||
public:
|
||||
SwigDirector_PythonDirectorCallbackClass(PyObject* self);
|
||||
virtual void on_zerotier_event(zts_event_msg_t* msg);
|
||||
|
||||
class SwigDirector_PythonDirectorCallbackClass : public PythonDirectorCallbackClass, public Swig::Director {
|
||||
|
||||
public:
|
||||
SwigDirector_PythonDirectorCallbackClass(PyObject *self);
|
||||
virtual void on_zerotier_event(zts_event_msg_t *msg);
|
||||
virtual ~SwigDirector_PythonDirectorCallbackClass();
|
||||
|
||||
/* Internal director utilities */
|
||||
public:
|
||||
bool swig_get_inner(const char* swig_protected_method_name) const
|
||||
{
|
||||
std::map<std::string, bool>::const_iterator iv = swig_inner.find(swig_protected_method_name);
|
||||
return (iv != swig_inner.end() ? iv->second : false);
|
||||
/* Internal director utilities */
|
||||
public:
|
||||
bool swig_get_inner(const char *swig_protected_method_name) const {
|
||||
std::map<std::string, bool>::const_iterator iv = swig_inner.find(swig_protected_method_name);
|
||||
return (iv != swig_inner.end() ? iv->second : false);
|
||||
}
|
||||
void swig_set_inner(const char* swig_protected_method_name, bool swig_val) const
|
||||
{
|
||||
swig_inner[swig_protected_method_name] = swig_val;
|
||||
void swig_set_inner(const char *swig_protected_method_name, bool swig_val) const {
|
||||
swig_inner[swig_protected_method_name] = swig_val;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
mutable std::map<std::string, bool> swig_inner;
|
||||
|
||||
#if defined(SWIG_PYTHON_DIRECTOR_VTABLE)
|
||||
/* VTable implementation */
|
||||
PyObject* swig_get_method(size_t method_index, const char* method_name) const
|
||||
{
|
||||
PyObject* method = vtable[method_index];
|
||||
if (! method) {
|
||||
swig::SwigVar_PyObject name = SWIG_Python_str_FromChar(method_name);
|
||||
method = PyObject_GetAttr(swig_get_self(), name);
|
||||
if (! method) {
|
||||
std::string msg = "Method in class PythonDirectorCallbackClass doesn't exist, undefined ";
|
||||
msg += method_name;
|
||||
Swig::DirectorMethodException::raise(msg.c_str());
|
||||
}
|
||||
vtable[method_index] = method;
|
||||
/* VTable implementation */
|
||||
PyObject *swig_get_method(size_t method_index, const char *method_name) const {
|
||||
PyObject *method = vtable[method_index];
|
||||
if (!method) {
|
||||
swig::SwigVar_PyObject name = SWIG_Python_str_FromChar(method_name);
|
||||
method = PyObject_GetAttr(swig_get_self(), name);
|
||||
if (!method) {
|
||||
std::string msg = "Method in class PythonDirectorCallbackClass doesn't exist, undefined ";
|
||||
msg += method_name;
|
||||
Swig::DirectorMethodException::raise(msg.c_str());
|
||||
}
|
||||
return method;
|
||||
vtable[method_index] = method;
|
||||
}
|
||||
return method;
|
||||
}
|
||||
|
||||
private:
|
||||
private:
|
||||
mutable swig::SwigVar_PyObject vtable[1];
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user