Hello

I have exactly the same requirement, but perhaps more specifically: how do I
get hold of the underlying boost::adjacency_list object to pass to C++ and
then extract from a boost::python::object?

To do this I just need to know two things: “stuff” and “command” in 

typedef boost::adjacency_list< stuff > Graph;

and

boost::python::eval(“command”,main_namespace)

respectively. I could then extract the adjacency_list object of a graph
created with graph-tool using boost::python::extract as follows:

boost::python::object python_graph =
boost::python::eval(“command”,main_namespace);

Graph &cpp_graph = boost::python::extract<Graph&amp;> (python_graph);

I have attached some complete sample code that does this for a class Dog
that is wrapped as a python module manually. If you could provide me with
what I could use for the equivalent graph-tool “command” and “stuff”
(obviously the later will vary depending on the graph type, but let’s say
just for the default type initially) that would be great thanks!

David

  Dog.h
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/t496146/Dog.h>
  
main.cpp
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/t496146/main.cpp>
  
module.cpp
<http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/file/t496146/module.cpp>
  



--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
_______________________________________________
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to