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

Try to map CSV file rows to edges according to value between a CSV column and a graph property. More...

#include <CSVGraphImport.h>

Inheritance diagram for tlp::CSVToGraphEdgeIdMapping:
Collaboration diagram for tlp::CSVToGraphEdgeIdMapping:

Public Member Functions

 CSVToGraphEdgeIdMapping (tlp::Graph *graph, unsigned int columnIndex, const std::string &propertyName)
- Public Member Functions inherited from tlp::AbstractCSVToGraphDataMapping
 AbstractCSVToGraphDataMapping (tlp::Graph *graph, tlp::ElementType type, unsigned int columnIndex, const std::string &propertyName)
virtual ~AbstractCSVToGraphDataMapping ()
void init (unsigned int rowNumber)
std::pair< tlp::ElementType,
unsigned int > 
getElementForRow (const std::vector< std::string > &tokens)
- Public Member Functions inherited from tlp::CSVToGraphDataMapping
virtual ~CSVToGraphDataMapping ()

Protected Member Functions

unsigned int buildIndexForRow (unsigned int row, const std::string &indexKey, tlp::Graph *graph, tlp::PropertyInterface *keyProperty)
 Create a new element if no elements for the given row was found.

Additional Inherited Members

- Protected Attributes inherited from tlp::AbstractCSVToGraphDataMapping
TLP_HASH_MAP< std::string,
unsigned int > 
valueToId
tlp::Graph * graph
tlp::ElementType type
unsigned int columnIndex
tlp::PropertyInterface * keyProperty

Detailed Description

Try to map CSV file rows to edges according to value between a CSV column and a graph property.

Be sure there is a property with the given name in the graph before using it.

Constructor & Destructor Documentation

tlp::CSVToGraphEdgeIdMapping::CSVToGraphEdgeIdMapping ( tlp::Graph *  graph,
unsigned int  columnIndex,
const std::string &  propertyName 
)
Parameters
graphThe graph where the edges will be searched.
columnIndexThe index of the column with the ids in the CSV file.
propertyNameThe name of the property to search ids.
firstRowThe first row to search ids.
lastRowThe last row to search ids.

Member Function Documentation

unsigned int tlp::CSVToGraphEdgeIdMapping::buildIndexForRow ( unsigned int  row,
const std::string &  indexKey,
tlp::Graph *  graph,
tlp::PropertyInterface *  keyProperty 
)
protectedvirtual

Create a new element if no elements for the given row was found.

Returns
Return the graph element id or UINT_MAX if no new element is created.

Implements tlp::AbstractCSVToGraphDataMapping.



Tulip Software by LaBRI Visualization Team    2001 - 2012