GraphWriter Class Template Reference
[LEMON Input-Output]


Detailed Description

template<typename _Graph>
class lemon::GraphWriter< _Graph >

This utility writes an LGF file.

It can be used almost the same way as DigraphWriter. The only difference is that this class can handle edges and edge maps as well as arcs and arc maps.

The arc maps are written into the file as two columns, the caption of the columns are the name of the map prefixed with '+' and '-'. The arcs are written into the @attributes section as a '+' or a '-' prefix (depends on the direction of the arc) and the label of corresponding edge. #include <lemon/lgf_writer.h>

List of all members.

Public Member Functions

 GraphWriter (const Graph &graph, std::ostream &os=std::cout)
 Constructor.
 GraphWriter (const Graph &graph, const std::string &fn)
 Constructor.
 GraphWriter (const Graph &graph, const char *fn)
 Constructor.
 ~GraphWriter ()
 Destructor.
Writing rules
template<typename Map >
GraphWriternodeMap (const std::string &caption, const Map &map)
 Node map writing rule.
template<typename Map , typename Converter >
GraphWriternodeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Node map writing rule.
template<typename Map >
GraphWriteredgeMap (const std::string &caption, const Map &map)
 Edge map writing rule.
template<typename Map , typename Converter >
GraphWriteredgeMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Edge map writing rule.
template<typename Map >
GraphWriterarcMap (const std::string &caption, const Map &map)
 Arc map writing rule.
template<typename Map , typename Converter >
GraphWriterarcMap (const std::string &caption, const Map &map, const Converter &converter=Converter())
 Arc map writing rule.
template<typename Value >
GraphWriterattribute (const std::string &caption, const Value &value)
 Attribute writing rule.
template<typename Value , typename Converter >
GraphWriterattribute (const std::string &caption, const Value &value, const Converter &converter=Converter())
 Attribute writing rule.
GraphWriternode (const std::string &caption, const Node &node)
 Node writing rule.
GraphWriteredge (const std::string &caption, const Edge &edge)
 Edge writing rule.
GraphWriterarc (const std::string &caption, const Arc &arc)
 Arc writing rule.
Section captions
GraphWriternodes (const std::string &caption)
 Add an additional caption to the @nodes section.
GraphWriteredges (const std::string &caption)
 Add an additional caption to the @arcs section.
GraphWriterattributes (const std::string &caption)
 Add an additional caption to the @attributes section.
Skipping section
GraphWriterskipNodes ()
 Skip writing the node set.
GraphWriterskipEdges ()
 Skip writing edge set.
Execution of the writer
void run ()
 Start the batch processing.
std::ostream & ostream ()
 Give back the stream of the writer.

Friends

GraphWriter< Graph > graphWriter (const Graph &graph, std::ostream &os)
 Return a GraphWriter class.
GraphWriter< Graph > graphWriter (const Graph &graph, const std::string &fn)
 Return a GraphWriter class.
GraphWriter< Graph > graphWriter (const Graph &graph, const char *fn)
 Return a GraphWriter class.


Constructor & Destructor Documentation

GraphWriter ( const Graph &  graph,
std::ostream &  os = std::cout 
) [inline]

Construct a directed graph writer, which writes to the given output stream.

GraphWriter ( const Graph &  graph,
const std::string &  fn 
) [inline]

Construct a directed graph writer, which writes to the given output file.

GraphWriter ( const Graph &  graph,
const char *  fn 
) [inline]

Construct a directed graph writer, which writes to the given output file.


Member Function Documentation

GraphWriter& nodeMap ( const std::string &  caption,
const Map &  map 
) [inline]

Add a node map writing rule to the writer.

GraphWriter& nodeMap ( const std::string &  caption,
const Map &  map,
const Converter &  converter = Converter() 
) [inline]

Add a node map writing rule with specialized converter to the writer.

GraphWriter& edgeMap ( const std::string &  caption,
const Map &  map 
) [inline]

Add an edge map writing rule to the writer.

GraphWriter& edgeMap ( const std::string &  caption,
const Map &  map,
const Converter &  converter = Converter() 
) [inline]

Add an edge map writing rule with specialized converter to the writer.

GraphWriter& arcMap ( const std::string &  caption,
const Map &  map 
) [inline]

Add an arc map writing rule to the writer.

GraphWriter& arcMap ( const std::string &  caption,
const Map &  map,
const Converter &  converter = Converter() 
) [inline]

Add an arc map writing rule with specialized converter to the writer.

GraphWriter& attribute ( const std::string &  caption,
const Value &  value 
) [inline]

Add an attribute writing rule to the writer.

GraphWriter& attribute ( const std::string &  caption,
const Value &  value,
const Converter &  converter = Converter() 
) [inline]

Add an attribute writing rule with specialized converter to the writer.

GraphWriter& node ( const std::string &  caption,
const Node &  node 
) [inline]

Add a node writing rule to the writer.

GraphWriter& edge ( const std::string &  caption,
const Edge &  edge 
) [inline]

Add an edge writing rule to writer.

GraphWriter& arc ( const std::string &  caption,
const Arc &  arc 
) [inline]

Add an arc writing rule to writer.

GraphWriter& nodes ( const std::string &  caption  )  [inline]

Add an additional caption to the @nodes section.

GraphWriter& edges ( const std::string &  caption  )  [inline]

Add an additional caption to the @arcs section.

GraphWriter& attributes ( const std::string &  caption  )  [inline]

Add an additional caption to the @attributes section.

GraphWriter& skipNodes (  )  [inline]

The @nodes section will not be written to the stream.

GraphWriter& skipEdges (  )  [inline]

The @edges section will not be written to the stream.

void run (  )  [inline]

This function starts the batch processing.

std::ostream& ostream (  )  [inline]

Give back the stream of the writer


Friends And Related Function Documentation

GraphWriter< Graph > graphWriter ( const Graph &  graph,
std::ostream &  os = std::cout 
) [friend]

This function just returns a GraphWriter class.

GraphWriter< Graph > graphWriter ( const Graph &  graph,
const std::string &  fn 
) [friend]

This function just returns a GraphWriter class.

GraphWriter< Graph > graphWriter ( const Graph &  graph,
const char *  fn 
) [friend]

This function just returns a GraphWriter class.


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

Generated on Sun Dec 7 10:49:45 2008 for LEMON by  doxygen 1.5.7.1