Qualified class names are a problem?
Given classes.h:
#include <string>
namespace mynamespace {
class Module
{
public:
Module (std::string s) {}
};
class ModuleCreator
{
public:
static Module* create() { return new Module("doh"); }
};
}
and a module to wrap these classes:
#! /usr/bin/env python
import sys
import pybindgen
from pybindgen import ReturnValue, Parameter, Module, Function, FileCodeSink
from pybindgen.utils import retval
def my_module_
mod = Module('blah')
mod.
c_Module = mod.add_
c_Module.
c_ModuleCreator = mod.add_
c_ModuleCre
mod.
if __name__ == '__main__':
my_
The generated module doesn't compile, as the fully-qualified class names are used in variable names. Relevant piece of generated module code:
PyObject *
_wrap_PyMynames
{
PyObject *py_retval;
mynamespace
PyMynamespa
retval = mynamespace:
if (!(retval)) {
return Py_None;
}
py_
py_
py_retval = Py_BuildValue((char *) "N", py_mynamespace:
return py_retval;
}
I don't want to add a submodule, so is there a way to accomplish what I want? (other than including a "using mynamespace;" line)
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PyBindGen Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Gustavo Carneiro
- Solved:
- Last query:
- Last reply: