Sparksee 6.1.0
ExportManager Class Referenceabstract

Defines how to export a graph to an external format. More...

#include <Export.h>

Inheritance diagram for ExportManager:
Inheritance graph

Public Member Functions

virtual ~ExportManager ()
 Destructor.
virtual void Prepare (Graph *graph)=0
 Prepares the graph for the export process.
virtual void Release ()=0
 Ends the export process.
virtual bool_t GetGraph (GraphExport &graphExport)=0
 Gets the graph export definition.
virtual bool_t GetNodeType (type_t type, NodeExport &nodeExport)=0
 Gets the default node export definition for the given node type.
virtual bool_t GetEdgeType (type_t type, EdgeExport &edgeExport)=0
 Gets the default node export definition for the given edge type.
virtual bool_t GetNode (oid_t node, NodeExport &nodeExport)=0
 Gets the node export definition for the given node.
virtual bool_t GetEdge (oid_t edge, EdgeExport &edgeExport)=0
 Gets the edge export definition for the given edge.
virtual bool_t EnableType (type_t type)=0
 Gets whether a node or edge type must be exported or not.
virtual bool_t ExportAll ()
 Get if all the graph object should be exported or only a subgraph It should return true (default option), to export all the nodes and edges in the Graph as with previous verions.
virtual oid_t NextNode ()
 Gets the next node to export or InvalidOID.
virtual oid_t NextEdge ()
 Gets the next edge to export or InvalidOID.

Detailed Description

Defines how to export a graph to an external format.

This is an interface which must be implemented by the user. While the export proces, a call for each node or edge type and node or edge object is done to get how to export that element.

It is possible to export a Graph to a diferent fortmats. Nowadays, available formats are defined in the ExportType enum.

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

Member Function Documentation

◆ EnableType()

virtual bool_t ExportManager::EnableType ( type_t type)
pure virtual

Gets whether a node or edge type must be exported or not.

Parameters
typeNode or edge type identifier.
Returns
If TRUE all objects of the given type will be exported, otherwise they will not be exported.

Implemented in DefaultExport.

◆ ExportAll()

virtual bool_t ExportManager::ExportAll ( )
inlinevirtual

Get if all the graph object should be exported or only a subgraph It should return true (default option), to export all the nodes and edges in the Graph as with previous verions.

Or false to use the new NextNode() and NextEdge() methods of this class to get the only nodes/edges that should be exported.

Returns
bool_t Returns true to export all the graph or false otherwise.

Reimplemented in DefaultExport.

◆ GetEdge()

virtual bool_t ExportManager::GetEdge ( oid_t edge,
EdgeExport & edgeExport )
pure virtual

Gets the edge export definition for the given edge.

Parameters
edgeEdge identifier.
edgeExport[out] The EdgeExport which defines how to export given edge.
Returns
TRUE if the given EdgeExport has been updated, otherwise FALSE will be returned and the default EdgeExport for the type the edge belongs to will be used.

Implemented in DefaultExport.

◆ GetEdgeType()

virtual bool_t ExportManager::GetEdgeType ( type_t type,
EdgeExport & edgeExport )
pure virtual

Gets the default node export definition for the given edge type.

GetEdge has a higher priority than this function. That is, only if GetEdge returns FALSE, the EdgeExport of this function will be used.

Parameters
type[in] Edge type identifier.
edgeExport[out] The EdgeExport which defines how to export the edges of the given type.
Returns
TRUE.

Implemented in DefaultExport.

◆ GetGraph()

virtual bool_t ExportManager::GetGraph ( GraphExport & graphExport)
pure virtual

Gets the graph export definition.

Parameters
graphExport[out] The GraphExport which defines how to export the graph.
Returns
TRUE.

Implemented in DefaultExport.

◆ GetNode()

virtual bool_t ExportManager::GetNode ( oid_t node,
NodeExport & nodeExport )
pure virtual

Gets the node export definition for the given node.

Parameters
nodeNode identifier.
nodeExport[out] The NodeExport which defines how to export given node.
Returns
TRUE if the given NodeExport has been updated, otherwise FALSE will be returned and the default NodeExport for the type the node belongs to will be used.

Implemented in DefaultExport.

◆ GetNodeType()

virtual bool_t ExportManager::GetNodeType ( type_t type,
NodeExport & nodeExport )
pure virtual

Gets the default node export definition for the given node type.

GetNode has a higher priority than this function. That is, only if GetNode returns FALSE, the NodeExport of this function will be used.

Parameters
type[in] Node type identifier.
nodeExport[out] The NodeExport which defines how to export the nodes of the given type.
Returns
TRUE.

Implemented in DefaultExport.

◆ NextEdge()

virtual oid_t ExportManager::NextEdge ( )
inlinevirtual

Gets the next edge to export or InvalidOID.

It will return valid edge OIDs to export and InvalidOID when there is not any more edges to export.

Precondition
ExportAll returns false.
Returns
oid_t Return an edge OID or InvalidOID

Reimplemented in DefaultExport.

References Objects::InvalidOID.

◆ NextNode()

virtual oid_t ExportManager::NextNode ( )
inlinevirtual

Gets the next node to export or InvalidOID.

It will return valid node OIDs to export and InvalidOID when there is not any more nodes to export.

Precondition
ExportAll returns false.
Returns
oid_t Return a node OID or InvalidOID

Reimplemented in DefaultExport.

References Objects::InvalidOID.

◆ Prepare()

virtual void ExportManager::Prepare ( Graph * graph)
pure virtual

Prepares the graph for the export process.

It is called once before the export process.

Parameters
graphGraph to be exported.

Implemented in DefaultExport.

◆ Release()

virtual void ExportManager::Release ( )
pure virtual

Ends the export process.

It is called once after the export process.

Implemented in DefaultExport.


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