PGROUTING  2.6-dev
pgrouting::trsp::Rule Class Reference

#include "rule.h"

Collaboration diagram for pgrouting::trsp::Rule:

Public Member Functions

 Rule (Restriction_t r)
 
double cost () const
 
int64_t dest_id () const
 
const std::vector< int64_t > precedencelist () const
 

Private Attributes

double m_cost
 
int64_t m_dest_id
 
std::vector< int64_t > m_precedencelist
 

Friends

std::ostream & operator<< (std::ostream &log, const Rule &r)
 

Detailed Description

Definition at line 39 of file rule.h.

Constructor & Destructor Documentation

Rule::Rule ( Restriction_t  r)
explicit

Definition at line 35 of file rule.cpp.

References m_dest_id, and m_precedencelist.

35  :
36  m_cost(r.cost),
37  m_precedencelist(r.via, r.via + r.via_size) {
38  m_dest_id = m_precedencelist.back();
39  m_precedencelist.pop_back();
40  std::reverse(m_precedencelist.begin(), m_precedencelist.end());
41  }
uint64_t via_size
Definition: restriction_t.h:63
int64_t * via
Definition: restriction_t.h:62
std::vector< int64_t > m_precedencelist
Definition: rule.h:59
int64_t m_dest_id
Definition: rule.h:57

Member Function Documentation

double pgrouting::trsp::Rule::cost ( ) const
inline

Definition at line 43 of file rule.h.

References m_cost, and precedencelist().

43  {
44  return m_cost;
45  }

Here is the call graph for this function:

int64_t pgrouting::trsp::Rule::dest_id ( ) const
inline

Definition at line 49 of file rule.h.

References m_dest_id, and operator<<.

49  {
50  return m_dest_id;
51  }
int64_t m_dest_id
Definition: rule.h:57
const std::vector< int64_t > Rule::precedencelist ( ) const

Definition at line 44 of file rule.cpp.

References m_precedencelist.

Referenced by cost().

44  {
45  return m_precedencelist;
46  }
std::vector< int64_t > m_precedencelist
Definition: rule.h:59

Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  log,
const Rule r 
)
friend

Definition at line 49 of file rule.cpp.

Referenced by dest_id().

49  {
50  log << r.m_cost << ", (";
51  for (const auto e : r.m_precedencelist) {
52  log << e << ",";
53  }
54  log << ")";
55  return log;
56  }

Member Data Documentation

double pgrouting::trsp::Rule::m_cost
private

Definition at line 58 of file rule.h.

Referenced by cost(), and pgrouting::trsp::operator<<().

int64_t pgrouting::trsp::Rule::m_dest_id
private

Definition at line 57 of file rule.h.

Referenced by dest_id(), and Rule().

std::vector<int64_t> pgrouting::trsp::Rule::m_precedencelist
private

Definition at line 59 of file rule.h.

Referenced by pgrouting::trsp::operator<<(), precedencelist(), and Rule().


The documentation for this class was generated from the following files: