PGROUTING  2.5
test_matrixRows_driver.h File Reference
Include dependency graph for test_matrixRows_driver.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool do_pgr_test_matrixRows (Matrix_cell_t *matrix_rows, size_t total_rows, char **log_msg, char **err_msg)
 

Function Documentation

bool do_pgr_test_matrixRows ( Matrix_cell_t matrix_rows,
size_t  total_rows,
char **  log_msg,
char **  err_msg 
)

Definition at line 39 of file test_matrixRows_driver.cpp.

References pgassert, and AssertFailedException::what().

Referenced by process().

43  {
44  std::ostringstream log;
45  std::ostringstream err;
46  try {
47  pgassert(!(*log_msg));
48  pgassert(!(*err_msg));
49 
50  std::vector< Matrix_cell_t > matrix(matrix_rows, matrix_rows + total_rows);
51 
52  log << "Original: \n" <<
53  std::setprecision(32);
54  for (const auto row : matrix) {
55  log << "start_vid = " << row.from_vid
56  << "\tend_vid = " << row.to_vid
57  << "\tagg_cost = " << row.cost;
58  }
59 
60  *err_msg = NULL;
61  *log_msg = strdup(log.str().c_str());
62  return true;
63  } catch (AssertFailedException &except) {
64  log << except.what() << "\n";
65  *err_msg = strdup(log.str().c_str());
66  return false;
67  } catch (std::exception& except) {
68  log << except.what() << "\n";
69  *err_msg = strdup(log.str().c_str());
70  return false;
71  } catch(...) {
72  log << "Caught unknown exception!\n";
73  *err_msg = strdup(log.str().c_str());
74  return false;
75  }
76 }
Extends std::exception and is the exception that we throw if an assert fails.
Definition: pgr_assert.h:126
#define pgassert(expr)
Uses the standard assert syntax.
Definition: pgr_assert.h:81
virtual const char * what() const
Definition: pgr_assert.cpp:53

Here is the call graph for this function:

Here is the caller graph for this function: