|
PGROUTING
3.2
|
Go to the documentation of this file.
53 std::ostringstream log;
54 std::ostringstream err;
55 std::ostringstream notice;
70 auto count = results.size();
73 (*return_tuples) = NULL;
76 "No components found";
80 (*return_tuples) =
pgr_alloc(count, (*return_tuples));
81 for (
size_t i = 0; i < count; i++) {
82 *((*return_tuples) + i) = results[i];
84 (*return_count) = count;
87 *log_msg = log.str().empty()?
90 *notice_msg = notice.str().empty()?
94 (*return_tuples) =
pgr_free(*return_tuples);
97 *err_msg =
pgr_msg(err.str().c_str());
98 *log_msg =
pgr_msg(log.str().c_str());
99 }
catch (std::exception &except) {
100 (*return_tuples) =
pgr_free(*return_tuples);
102 err << except.what();
103 *err_msg =
pgr_msg(err.str().c_str());
104 *log_msg =
pgr_msg(log.str().c_str());
106 (*return_tuples) =
pgr_free(*return_tuples);
108 err <<
"Caught unknown exception!";
109 *err_msg =
pgr_msg(err.str().c_str());
110 *log_msg =
pgr_msg(log.str().c_str());
T * pgr_alloc(std::size_t size, T *ptr)
allocates memory
char * pgr_msg(const std::string &msg)
virtual const char * what() const
#define pgassert(expr)
Uses the standard assert syntax.
void insert_edges(const T *edges, size_t count)
Inserts count edges of type T into the graph.
An assert functionality that uses C++ throw().
std::vector< pgr_components_rt > strongComponents(pgrouting::DirectedGraph &graph)
Strongly Connected Components Vertex Version.
void do_pgr_strongComponents(pgr_edge_t *data_edges, size_t total_edges, pgr_components_rt **return_tuples, size_t *return_count, char **log_msg, char **notice_msg, char **err_msg)
Extends std::exception and is the exception that we throw if an assert fails.