PGROUTING  2.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pgr_alloc.hpp File Reference
#include "./postgres_connection.h"
#include <utils/palloc.h>
#include <string>

Go to the source code of this file.

Functions

template<typename T >
T * pgr_alloc (std::size_t size, T *ptr)
 allocates memory More...
 
template<typename T >
T * pgr_free (T *ptr)
 
char * pgr_msg (const std::string &msg)
 

Function Documentation

template<typename T >
pgr_alloc ( std::size_t  size,
T *  ptr 
)

allocates memory

  • Does a malloc or realloc depending on the ptr value
  • To be used only on C++ code
  • To be used when returning results to postgres
  • free must occur in the C code
Parameters
[in]size
[in]ptr
Returns
pointer to the first byte of allocated space

Definition at line 62 of file pgr_alloc.hpp.

Referenced by alpha_shape(), BiDirAStar::bidir_astar(), do_pgr_astarManyToMany(), do_pgr_bdDijkstra(), do_pgr_dijkstraVia(), do_pgr_driving_many_to_dist(), do_pgr_edge_disjoint_paths(), do_pgr_eucledianTSP(), do_pgr_ksp(), do_pgr_many_to_many_dijkstra(), do_pgr_many_to_many_withPoints(), do_pgr_many_withPointsDD(), do_pgr_max_flow(), do_pgr_maximum_cardinality_matching(), do_pgr_pickDeliver(), do_pgr_tsp(), do_pgr_withPointsKsp(), find_vrp_solution(), get_postgres_result(), Pgr_allpairs< G >::make_result(), and pgr_msg().