[CastXML] Runtime error while finding element_type with containers of pointers

Ankit Deepak adadeepak8 at gmail.com
Fri May 19 10:03:41 EDT 2017


Hello all,

I have started working on CastXML recently. I am trying to modify pybindgen
[1] to work with CastXML and latest versions of pygccxml. "__find_xxx_type"
of "container_traits" throws Runtime Error when it encounters std
containers having pointers as elements, it works fine with other
containers. The traceback looks like:

Traceback (most recent call last):
  File
"/home/ankit/Videos/bake/source/ns-3-dev/bindings/python/ns3modulescan-modular.py",
line 284, in <module>
    ns3_module_scan(sys.argv[1], sys.argv[2], eval(sys.argv[3]),
sys.argv[4], sys.argv[5])
  File
"/home/ankit/Videos/bake/source/ns-3-dev/bindings/python/ns3modulescan-modular.py",
line 265, in ns3_module_scan
    module_parser.scan_types()
  File
"/home/ankit/Videos/bake/source/pybindgen/pybindgen/castxmlparser.py", line
801, in scan_types
    self._scan_namespace_types(self.module, self.module_namespace,
pygen_register_function_name="register_types")
  File
"/home/ankit/Videos/bake/source/pybindgen/pybindgen/castxmlparser.py", line
1334, in _scan_namespace_types
    self._register_container(module, traits, type_info, _outer_class, name)
  File
"/home/ankit/Videos/bake/source/pybindgen/pybindgen/castxmlparser.py", line
1522, in _register_container
    element_type = traits.element_type(definition)
  File
"build/bdist.linux-x86_64/egg/pygccxml/declarations/container_traits.py",
line 494, in element_type
  File
"build/bdist.linux-x86_64/egg/pygccxml/declarations/container_traits.py",
line 484, in __find_xxx_type
RuntimeError: Unable to find out list '::std::list<ns3::ArpCache::Entry *,
std::allocator<ns3::ArpCache::Entry *> >' key\value type.

Similarly, it fails with

RuntimeError: Unable to find out map '::std::map<std::basic_string<char>,
ns3::LogComponent *, std::less<std::basic_string<char> >,
std::allocator<std::pair<const std::basic_string<char>, ns3::LogComponent
*> > >' key\value type.

Am I missing something regarding such containers? Please advise.

I am sorry if I was unable to explain everything clearly.

[1] https://github.com/gjcarneiro/pybindgen

Thanks,
Ankit Deepak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/castxml/attachments/20170519/a6355979/attachment.html>


More information about the CastXML mailing list