Go to the source code of this file.
◆ do_pgr_topologicalSort()
void do_pgr_topologicalSort |
( |
pgr_edge_t * |
data_edges, |
|
|
size_t |
total_tuples, |
|
|
pgr_topologicalSort_t ** |
return_tuples, |
|
|
size_t * |
return_count, |
|
|
char ** |
log_msg, |
|
|
char ** |
notice_msg, |
|
|
char ** |
err_msg |
|
) |
| |
Definition at line 57 of file topologicalSort_driver.cpp.
67 std::ostringstream log;
68 std::ostringstream err;
69 std::ostringstream notice;
81 std::vector<pgr_topologicalSort_t> results;
83 log <<
"Working with Directed Graph\n";
85 digraph.insert_edges(data_edges, total_edges);
89 auto count = results.size();
92 (*return_tuples) = NULL;
99 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
100 for (
size_t i = 0; i < count; i++) {
101 *((*return_tuples) + i) = results[i];
103 (*return_count) = count;
106 *log_msg = log.str().empty()?
109 *notice_msg = notice.str().empty()?
113 (*return_tuples) =
pgr_free(*return_tuples);
115 err << except.
what();
116 *err_msg =
pgr_msg(err.str().c_str());
117 *log_msg =
pgr_msg(log.str().c_str());
118 }
catch (std::exception &except) {
119 (*return_tuples) =
pgr_free(*return_tuples);
121 err << except.what();
122 *err_msg =
pgr_msg(err.str().c_str());
123 *log_msg =
pgr_msg(log.str().c_str());
125 (*return_tuples) =
pgr_free(*return_tuples);
127 err <<
"Caught unknown exception!";
128 *err_msg =
pgr_msg(err.str().c_str());
129 *log_msg =
pgr_msg(log.str().c_str());
References DIRECTED, pgrouting::graph::Pgr_base_graph< G, T_V, T_E >::insert_edges(), pgassert, pgr_alloc(), pgr_free(), pgr_msg(), pgr_topologicalSort(), and AssertFailedException::what().
Referenced by process().