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