Overview     Modules     Class Hierarchy     Classes     Members  
tlp::CSVToGraphEdgeSrcTgtMapping Class Reference

Try to map CSV file rows to edges according to edge source and destination. More...

#include <CSVGraphImport.h>

Inheritance diagram for tlp::CSVToGraphEdgeSrcTgtMapping:
Collaboration diagram for tlp::CSVToGraphEdgeSrcTgtMapping:

List of all members.

Public Member Functions

  • CSVToGraphEdgeSrcTgtMapping (tlp::Graph *graph, unsigned int srcColumnIndex, unsigned int tgtColumnIndex, const std::string &propertyName, bool createMissinElements=false)
  • std::pair< tlp::ElementType,
    unsigned int > getElementForRow (unsigned int row)
  • void init (unsigned int lineNumbers)
  • std::pair< tlp::ElementType,
    unsigned int > getElementForRow (const std::vector< std::string > &tokens)

Detailed Description

Try to map CSV file rows to edges according to edge source and destination.

For each row in the CSV file create an edge in the graph between source and destination nodes. Find source node by comparing id in the source CSV column and destination node by comparing id in the destination CSV column.


Constructor & Destructor Documentation

tlp::CSVToGraphEdgeSrcTgtMapping::CSVToGraphEdgeSrcTgtMapping ( tlp::Graph *  graph,
unsigned int  srcColumnIndex,
unsigned int  tgtColumnIndex,
const std::string &  propertyName,
bool  createMissinElements = false 
)
Parameters:
graphThe graph where the edges will be searched.
srcColumnIndexThe index of the column with the source node id in the CSV file.
tgtColumnIndexThe index of the column with the taret node id in the CSV file.
srcPropertyNameThe name of the property to search source node id.
tgtPropertyNameThe name of the property to search target node id.
firstRowThe first row to search ids.
lastRowThe last row to search ids.
createMissinElementsIf true create source node, destination node if one of them is not found in the graph.

Member Function Documentation

std::pair<tlp::ElementType,unsigned int> tlp::CSVToGraphEdgeSrcTgtMapping::getElementForRow ( unsigned int  row)
std::pair<tlp::ElementType,unsigned int> tlp::CSVToGraphEdgeSrcTgtMapping::getElementForRow ( const std::vector< std::string > &  tokens) [virtual]
void tlp::CSVToGraphEdgeSrcTgtMapping::init ( unsigned int  lineNumbers) [virtual]


Tulip Software by LaBRI Visualization Team    2001 - 2012