Overview | Modules | Class Hierarchy | Classes | Members

Public Member Functions | Protected Member Functions | Protected Attributes
tlp::AbstractCSVToGraphDataMapping Class Reference

Abstract class handling node or edge mapping between a CSV column and a graph property. More...

`#include <CSVGraphImport.h>`

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

List of all members.

## Public Member Functions

- 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)

## Protected Member Functions

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

## Protected Attributes

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

## Detailed Description

Abstract class handling node or edge mapping between a CSV column and a graph property.

Be sure there is a property with the given name in the graph or an error will occur. Automatically handle CSV file parsing just implements the buildIndexForRow function to fill the rowToGraphId map with the right graph element.

## Constructor & Destructor Documentation

tlp::AbstractCSVToGraphDataMapping::AbstractCSVToGraphDataMapping | ( | tlp::Graph * | graph,
|  | tlp::ElementType | type,
|  | unsigned int | columnIndex,
|  | const std::string & | propertyName
| ) |  |

virtual tlp::AbstractCSVToGraphDataMapping::~AbstractCSVToGraphDataMapping | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

virtual unsigned int tlp::AbstractCSVToGraphDataMapping::buildIndexForRow | ( | unsigned int | row,
|  | const std::string & | indexKey,
|  | tlp::Graph * | graph,
|  | tlp::PropertyInterface * | keyProperty
| ) |  | `[protected, pure 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.

Implemented in tlp::CSVToGraphNodeIdMapping, and tlp::CSVToGraphEdgeIdMapping.

std::pair<tlp::ElementType,unsigned int> tlp::AbstractCSVToGraphDataMapping::getElementForRow | ( | const std::vector< std::string > & | tokens | ) | `[virtual]`

Implements tlp::CSVToGraphDataMapping.

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

Implements tlp::CSVToGraphDataMapping.

Reimplemented in tlp::CSVToGraphNodeIdMapping.

## Member Data Documentation

unsigned int tlp::AbstractCSVToGraphDataMapping::columnIndex`[protected]`

tlp::Graph* tlp::AbstractCSVToGraphDataMapping::graph`[protected]`

tlp::PropertyInterface* tlp::AbstractCSVToGraphDataMapping::keyProperty`[protected]`

tlp::ElementType tlp::AbstractCSVToGraphDataMapping::type`[protected]`

TLP_HASH_MAP<std::string,unsigned int> tlp::AbstractCSVToGraphDataMapping::valueToId`[protected]`

Tulip Software by LaBRI Visualization Team 2001 - 2012