<div dir="ltr">Hello all,<div><br></div><div>I think I found out where the error was. The problem was not with the pointer but the space between the type and '*' operator. When working with pointers, "find_value_type" of "traits_impl_details" removes the '*' using a substring operation, and when that happened, it tried to find the type of the actual type along with a space. If this is not an intended behaviour of the code, then a possible enhancement could be to strip the type string of the trailing spaces before the find operation.</div><div><br></div><div>Thanks,</div><div>Ankit Deepak</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 19, 2017 at 7:33 PM, Ankit Deepak <span dir="ltr"><<a href="mailto:adadeepak8@gmail.com" target="_blank">adadeepak8@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello all,<div><br></div><div>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:</div><div><br></div><div><div>Traceback (most recent call last):</div><div>  File "/home/ankit/Videos/bake/<wbr>source/ns-3-dev/bindings/<wbr>python/ns3modulescan-modular.<wbr>py", line 284, in <module></div><div>    ns3_module_scan(sys.argv[1], sys.argv[2], eval(sys.argv[3]), sys.argv[4], sys.argv[5])</div><div>  File "/home/ankit/Videos/bake/<wbr>source/ns-3-dev/bindings/<wbr>python/ns3modulescan-modular.<wbr>py", line 265, in ns3_module_scan</div><div>    module_parser.scan_types()</div><div>  File "/home/ankit/Videos/bake/<wbr>source/pybindgen/pybindgen/<wbr>castxmlparser.py", line 801, in scan_types</div><div>    self._scan_namespace_types(<wbr>self.module, self.module_namespace, pygen_register_function_name="<wbr>register_types")</div><div>  File "/home/ankit/Videos/bake/<wbr>source/pybindgen/pybindgen/<wbr>castxmlparser.py", line 1334, in _scan_namespace_types</div><div>    self._register_container(<wbr>module, traits, type_info, _outer_class, name)</div><div>  File "/home/ankit/Videos/bake/<wbr>source/pybindgen/pybindgen/<wbr>castxmlparser.py", line 1522, in _register_container</div><div>    element_type = traits.element_type(<wbr>definition)</div><div>  File "build/bdist.linux-x86_64/egg/<wbr>pygccxml/declarations/<wbr>container_traits.py", line 494, in element_type</div><div>  File "build/bdist.linux-x86_64/egg/<wbr>pygccxml/declarations/<wbr>container_traits.py", line 484, in __find_xxx_type</div><div>RuntimeError: Unable to find out list '::std::list<ns3::ArpCache::<wbr>Entry *, std::allocator<ns3::ArpCache::<wbr>Entry *> >' key\value type.</div></div><div><font size="1"><br></font></div><div>Similarly, it fails with</div><div><br></div><div>RuntimeError: Unable to find out map '::std::map<std::basic_string<<wbr>char>, ns3::LogComponent *, std::less<std::basic_string<<wbr>char> >, std::allocator<std::pair<const std::basic_string<char>, ns3::LogComponent *> > >' key\value type.<br></div><div><br></div><div>Am I missing something regarding such containers? Please advise.</div><div><br></div><div>I am sorry if I was unable to explain everything clearly.</div><div><br></div><div>[1] <a href="https://github.com/gjcarneiro/pybindgen" target="_blank">https://github.com/<wbr>gjcarneiro/pybindgen</a></div><div><br></div><div>Thanks,</div><div>Ankit Deepak</div></div>
</blockquote></div><br></div>