Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions | Protected Member Functions
tlp::CSVToGraphNodeIdMapping Class Reference

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

`#include <CSVGraphImport.h>`

Inheritance diagram for tlp::CSVToGraphNodeIdMapping:
[legend]
Collaboration diagram for tlp::CSVToGraphNodeIdMapping:
[legend]

List of all members.

## Public Member Functions

- CSVToGraphNodeIdMapping (tlp::Graph *graph, unsigned int columnIndex, const std::string &propertyName, bool createNode=false)
- void init (unsigned int rowNumber)

## 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.

## Detailed Description

Try to map CSV file rows to nodes 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::CSVToGraphNodeIdMapping::CSVToGraphNodeIdMapping | ( | tlp::Graph * | graph,
|  | unsigned int | columnIndex,
|  | const std::string & | propertyName,
|  | bool | createNode = `false`
| ) |  |

Parameters:

  graph | The graph where the nodes will be searched.
  columnIndex | The index of the column with the ids in the CSV file.
  propertyName | The name of the property to search ids.
  firstRow | The first row to search ids.
  lastRow | The last row to search ids.
  createNode | If set to true if there is no node for an id in the CSV file a new node will be created for this id.

## Member Function Documentation

unsigned int tlp::CSVToGraphNodeIdMapping::buildIndexForRow | ( | unsigned int | row,
|  | const std::string & | indexKey,
|  | tlp::Graph * | graph,
|  | tlp::PropertyInterface * | keyProperty
| ) |  | `[protected, virtual]`

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.

void tlp::CSVToGraphNodeIdMapping::init | ( | unsigned int | rowNumber | ) | `[virtual]`

Reimplemented from tlp::AbstractCSVToGraphDataMapping.

Tulip Software by LaBRI Visualization Team 2001 - 2012