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

 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

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

Member Function Documentation

virtual unsigned int tlp::AbstractCSVToGraphDataMapping::buildIndexForRow ( unsigned int  row,
const std::string &  indexKey,
tlp::Graph *  graph,
tlp::PropertyInterface *  keyProperty 
)
protectedpure 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::CSVToGraphEdgeIdMapping, and tlp::CSVToGraphNodeIdMapping.

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

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