Line data Source code
1 : /* 2 : * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. 3 : */ 4 : 5 : #include "db/db_graph_edge.h" 6 : 7 : #include "db/db_graph.h" 8 : 9 648581 : DBGraphEdge::DBGraphEdge() { 10 648581 : } 11 : 12 191677 : void DBGraphEdge::SetEdge(Edge edge) { 13 191677 : assert(!IsDeleted()); 14 191677 : edge_id_ = edge; 15 191677 : } 16 : 17 117394 : DBGraphVertex *DBGraphEdge::source(DBGraph *graph) { 18 117394 : Vertex s = boost::source(edge_id_, *graph->graph()); 19 117394 : return graph->vertex_data(s); 20 : } 21 : 22 0 : const DBGraphVertex *DBGraphEdge::source(DBGraph *graph) const { 23 0 : Vertex s = boost::source(edge_id_, *graph->graph()); 24 0 : return graph->vertex_data(s); 25 : } 26 : 27 298103 : DBGraphVertex *DBGraphEdge::target(DBGraph *graph) { 28 298103 : Vertex t = boost::target(edge_id_, *graph->graph()); 29 298103 : return graph->vertex_data(t); 30 : } 31 : 32 0 : const DBGraphVertex *DBGraphEdge::target(DBGraph *graph) const { 33 0 : Vertex t = boost::target(edge_id_, *graph->graph()); 34 0 : return graph->vertex_data(t); 35 : } 36 :