Overview     Modules     Class Hierarchy     Classes     Members  
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:
Collaboration diagram for tlp::AbstractCSVToGraphDataMapping:

List of all members.

Public Member Functions

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


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]
void tlp::AbstractCSVToGraphDataMapping::init ( unsigned int  rowNumber) [virtual]

Member Data Documentation

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