LCOV - code coverage report
Current view: top level - db - db_graph_edge.h (source / functions) Hit Total Coverage
Test: OpenSDN C/C++ coverage (all TARGET_SET jobs) Lines: 3 3 100.0 %
Date: 2026-06-22 02:21:21 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       2             :  * Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
       3             :  */
       4             : 
       5             : #ifndef __DB_DB_GRAPH_EDGE_H__
       6             : #define __DB_DB_GRAPH_EDGE_H__
       7             : 
       8             : #include "base/util.h"
       9             : 
      10             : #include "db/db_entry.h"
      11             : #include "db/db_graph_base.h"
      12             : 
      13             : class DBGraph;
      14             : class DBGraphVertex;
      15             : 
      16             : class DBGraphEdge : public DBEntry {
      17             : public:
      18             :     typedef DBGraphBase::vertex_descriptor Vertex;
      19             :     typedef DBGraphBase::edge_descriptor Edge;
      20             : 
      21             :     DBGraphEdge();
      22             : 
      23             :     void SetEdge(Edge edge);
      24             : 
      25      159813 :     Edge edge_id() const {
      26      159813 :         assert(!IsDeleted());
      27             :         // Don't access the edge id after deleting from graph
      28      159813 :         return edge_id_;
      29             :     }
      30             : 
      31             :     DBGraphVertex *source(DBGraph *graph);
      32             :     const DBGraphVertex *source(DBGraph *graph) const;
      33             : 
      34             :     DBGraphVertex *target(DBGraph *graph);
      35             :     const DBGraphVertex *target(DBGraph *graph) const;
      36             : 
      37             :     virtual const std::string &name() const = 0;
      38             : private:
      39             :     Edge edge_id_;
      40             : 
      41             :     DISALLOW_COPY_AND_ASSIGN(DBGraphEdge);
      42             : };
      43             : 
      44             : #endif

Generated by: LCOV version 1.14