Sparksee  6.0.2
TypeExporter Class Referenceabstract

Base TypeExporter class. More...

Inheritance diagram for TypeExporter:
Inheritance graph

Public Member Functions

virtual ~TypeExporter ()
 Destructor.
 
void Register (TypeExporterListener &tel)
 Registers a new listener. More...
 
virtual void Run ()=0 throw (sparksee::gdb::IOException, sparksee::gdb::Error)
 Runs export process. More...
 
void SetRowWriter (RowWriter &rw)
 Sets the output data destination. More...
 
void SetGraph (sparksee::gdb::Graph &graph)
 Sets the graph that will be exported. More...
 
void SetType (sparksee::gdb::type_t type)
 Sets the type to be exported. More...
 
void SetAttributes (sparksee::gdb::AttributeList &attrs)
 Sets the list of Attributes. More...
 
void SetFrequency (sparksee::gdb::int32_t freq)
 Sets the frequency of listener notification. More...
 
void SetHeader (sparksee::gdb::bool_t header)
 Sets the presence of a header row. More...
 

Protected Member Functions

 TypeExporter ()
 Creates a new instance.
 
 TypeExporter (RowWriter &rw, sparksee::gdb::Graph &g, sparksee::gdb::type_t t, sparksee::gdb::AttributeList &attrs)
 Creates a new instance with the minimum common required arguments. More...
 
sparksee::gdb::bool_t CanRun ()
 Checks that all the required settings are ready to run. More...
 
void NotifyListeners (const TypeExporterEvent &ev)
 Notifies progress to all registered listeners. More...
 
void RunProcess () throw (sparksee::gdb::IOException, sparksee::gdb::Error)
 Runs export process. More...
 
void SetHeadAttribute (sparksee::gdb::attr_t attr)
 Sets the attribute that will be used to get the value to be dumped for the head of the edge. More...
 
void SetHeadPosition (sparksee::gdb::int32_t pos)
 Sets the position (index column) of the head attribute in the exported data. More...
 
void SetTailAttribute (sparksee::gdb::attr_t attr)
 Sets the attribute that will be used to get the value to be dumped for the tail of the edge. More...
 
void SetTailPosition (sparksee::gdb::int32_t pos)
 Sets the position (index column) of the tail attribute in the exported data. More...
 

Detailed Description

Base TypeExporter class.

Base class to export a node or edge type from a graph using a RowWriter.

TypeExporterListener can be registered to receive information about the progress of the export process by means of TypeExporterEvent. The default frequency of notification to listeners is 100000.

By default no header row is created.

Check out the 'Data export' section in the SPARKSEE User Manual for more details on this.

Author
Sparsity Technologies http://www.sparsity-technologies.com

Constructor & Destructor Documentation

TypeExporter::TypeExporter ( RowWriter rw,
sparksee::gdb::Graph &  g,
sparksee::gdb::type_t  t,
sparksee::gdb::AttributeList &  attrs 
)
protected

Creates a new instance with the minimum common required arguments.

Parameters
rw[in] Output RowWriter.
g[in] Graph.
t[in] Type identifier.
attrs[in] Attribute identifiers to be exported.

Member Function Documentation

sparksee::gdb::bool_t TypeExporter::CanRun ( )
protected

Checks that all the required settings are ready to run.

Returns
Returns true if all the settings are ready.
void TypeExporter::NotifyListeners ( const TypeExporterEvent ev)
protected

Notifies progress to all registered listeners.

Parameters
ev[in] Progress event to be notified.
void TypeExporter::Register ( TypeExporterListener tel)

Registers a new listener.

Parameters
tel[in] TypeExporterListener to be registered.
virtual void TypeExporter::Run ( )
throw (sparksee::gdb::IOException,
sparksee::gdb::Error
)
pure virtual

Runs export process.

Exceptions
IOExceptionIf bad things happen writing to the RowWriter.

Implemented in EdgeTypeExporter, and NodeTypeExporter.

void TypeExporter::RunProcess ( )
throw (sparksee::gdb::IOException,
sparksee::gdb::Error
)
protected

Runs export process.

Exceptions
IOExceptionIf bad things happen writting to the RowWriter.
void TypeExporter::SetAttributes ( sparksee::gdb::AttributeList &  attrs)

Sets the list of Attributes.

Parameters
attrs[in] Attribute identifiers to be exported
void TypeExporter::SetFrequency ( sparksee::gdb::int32_t  freq)

Sets the frequency of listener notification.

Parameters
freq[in] Frequency in number of rows managed to notify progress to all listeners
void TypeExporter::SetGraph ( sparksee::gdb::Graph &  graph)

Sets the graph that will be exported.

Parameters
graph[in] Graph.
void TypeExporter::SetHeadAttribute ( sparksee::gdb::attr_t  attr)
protected

Sets the attribute that will be used to get the value to be dumped for the head of the edge.

This method is protected because only the Edge exporters should have it.

Parameters
attr[in] Head Attribute

Referenced by EdgeTypeExporter::EdgeTypeExporter(), and EdgeTypeExporter::SetHeadAttribute().

void TypeExporter::SetHeader ( sparksee::gdb::bool_t  header)

Sets the presence of a header row.

Parameters
header[in] If TRUE, a header row is dumped with the name of the attributes.
void TypeExporter::SetHeadPosition ( sparksee::gdb::int32_t  pos)
protected

Sets the position (index column) of the head attribute in the exported data.

This method is protected because only the Edge exporters should have it.

Parameters
pos[in] Head position

Referenced by EdgeTypeExporter::EdgeTypeExporter(), and EdgeTypeExporter::SetHeadPosition().

void TypeExporter::SetRowWriter ( RowWriter rw)

Sets the output data destination.

Parameters
rw[in] Input RowWriter.
void TypeExporter::SetTailAttribute ( sparksee::gdb::attr_t  attr)
protected

Sets the attribute that will be used to get the value to be dumped for the tail of the edge.

This method is protected because only the Edge exporters should have it.

Parameters
attr[in] Tail Attribute

Referenced by EdgeTypeExporter::EdgeTypeExporter(), and EdgeTypeExporter::SetTailAttribute().

void TypeExporter::SetTailPosition ( sparksee::gdb::int32_t  pos)
protected

Sets the position (index column) of the tail attribute in the exported data.

This method is protected because only the Edge exporters should have it.

Parameters
pos[in] Tail position

Referenced by EdgeTypeExporter::EdgeTypeExporter(), and EdgeTypeExporter::SetTailPosition().

void TypeExporter::SetType ( sparksee::gdb::type_t  type)

Sets the type to be exported.

Parameters
type[in] Type identifier.

The documentation for this class was generated from the following file: