PGROUTING  2.6-dev
Restriction Class Reference

#include "restriction.h"

Collaboration diagram for Restriction:

Public Member Functions

 Restriction ()=default
 
 Restriction (const Restrict_t &r)
 
void clear ()
 
double cost () const
 
void cost (const double &value)
 
int64_t id () const
 
void id (const int64_t &value)
 
std::vector< int64_t > restrict_edges () const
 
void restrict_edges (const int64_t &value)
 
int64_t restriction_size () const
 

Private Attributes

double m_cost
 
int64_t m_id
 
std::vector< int64_t > m_restrict_edges
 

Friends

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

Detailed Description

Definition at line 38 of file restriction.h.

Constructor & Destructor Documentation

Restriction::Restriction ( )
default
Restriction::Restriction ( const Restrict_t &  r)
explicit

Definition at line 33 of file restriction.cpp.

References restrict_edges().

33  :
34  m_id(r.id),
35  m_cost(r.cost) {
36  for (auto &it : r.restricted_edges) {
37  if (it == -1) break;
38  restrict_edges(it);
39  }
40  }
int64_t m_id
Definition: restriction.h:40
double m_cost
Definition: restriction.h:42
std::vector< int64_t > restrict_edges() const
Definition: restriction.h:54

Here is the call graph for this function:

Member Function Documentation

void Restriction::clear ( )
inline

Definition at line 60 of file restriction.h.

60  {
61  m_restrict_edges.clear();
62  }
std::vector< int64_t > m_restrict_edges
Definition: restriction.h:41
double Restriction::cost ( ) const
inline

Definition at line 51 of file restriction.h.

References m_cost.

Referenced by operator<<().

51 {return m_cost;}
double m_cost
Definition: restriction.h:42

Here is the caller graph for this function:

void Restriction::cost ( const double &  value)
inline

Definition at line 52 of file restriction.h.

52 {m_cost = value;}
double m_cost
Definition: restriction.h:42
int64_t Restriction::id ( ) const
inline

Definition at line 48 of file restriction.h.

References m_id.

Referenced by operator<<().

48 {return m_id;}
int64_t m_id
Definition: restriction.h:40

Here is the caller graph for this function:

void Restriction::id ( const int64_t &  value)
inline

Definition at line 49 of file restriction.h.

49 {m_id = value;}
int64_t m_id
Definition: restriction.h:40
std::vector< int64_t > Restriction::restrict_edges ( ) const
inline

Definition at line 54 of file restriction.h.

References m_restrict_edges.

Referenced by Pgr_dijkstraTRSP< G >::has_a_restriction(), Pgr_dijkstraTRSP< G >::has_restriction(), operator<<(), and Restriction().

54 {return m_restrict_edges;}
std::vector< int64_t > m_restrict_edges
Definition: restriction.h:41

Here is the caller graph for this function:

void Restriction::restrict_edges ( const int64_t &  value)
inline

Definition at line 56 of file restriction.h.

56  {
57  m_restrict_edges.push_back(value);
58  }
std::vector< int64_t > m_restrict_edges
Definition: restriction.h:41
int64_t Restriction::restriction_size ( ) const
inline

Definition at line 64 of file restriction.h.

References operator<<.

64 {return m_restrict_edges.size();}
std::vector< int64_t > m_restrict_edges
Definition: restriction.h:41

Friends And Related Function Documentation

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

Definition at line 43 of file restriction.cpp.

Referenced by restriction_size().

43  {
44  log << "\n--------------------------------\nRestriction\n";
45  log << "ID: " << r.id() << "\nRestricion edge sequence: ";
46  for (const auto &v : r.restrict_edges()) {
47  log << v <<" ";
48  }
49  log << "\n";
50  log << "Cost: " << r.cost() << "\n";
51  return log;
52 }
double cost() const
Definition: restriction.h:51
int64_t id() const
Definition: restriction.h:48
std::vector< int64_t > restrict_edges() const
Definition: restriction.h:54

Member Data Documentation

double Restriction::m_cost
private

Definition at line 42 of file restriction.h.

Referenced by cost().

int64_t Restriction::m_id
private

Definition at line 40 of file restriction.h.

Referenced by id().

std::vector< int64_t > Restriction::m_restrict_edges
private

Definition at line 41 of file restriction.h.

Referenced by restrict_edges().


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