Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

UndirEdgeSetReader Class Template Reference
[Input Output]

#include <lemon/lemon_reader.h>

Inherits CommonSectionReaderBase.

Inheritance diagram for UndirEdgeSetReader:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename _Graph, typename _Traits = DefaultReaderTraits>
class lemon::UndirEdgeSetReader< _Graph, _Traits >

The lemon format can store multiple undirected edgesets with several maps. The undirected edgeset section's header line is @undiredgeset undiredgeset_id, but the undiredgeset_id may be empty.

The first line of the section contains the names of the maps separated with white spaces. Each next lines describes an edge in the edgeset. The line contains the connected nodes' id and the mapped values for each map.

The section can handle the directed as a syntactical sugar. Two undirected edge map describes one directed edge map. This two maps are the forward map and the backward map and the names of this map is near the same just with a prefix '+' or '-' character difference.

If the edgeset contains an "id" named map then it will be regarded as id map. This map should contain only unique values and when the readId() member will read a value from the given stream it will give back that undiricted edge which is mapped to this value.

The undirected edgeset reader needs a node id reader to identify which nodes have to be connected. If a NodeSetReader reads an "id" named map, it will be able to resolve the nodes by ids.


Public Member Functions

template<typename NodeIdReader>
 UndirEdgeSetReader (LemonReader &_reader, typename SmartParameter< Graph >::Type _graph, const NodeIdReader &_nodeIdReader, const std::string &_id=std::string(), const DefaultSkipper &_skipper=DefaultSkipper())
 Constructor.
virtual ~UndirEdgeSetReader ()
 Destructor.
template<typename Map>
UndirEdgeSetReaderreadUndirEdgeMap (std::string name, Map &map)
 Add a new undirected edge map reader command for the reader.
template<typename Reader, typename Map>
UndirEdgeSetReaderreadUndirEdgeMap (std::string name, Map &map, const Reader &reader=Reader())
 Add a new undirected edge map reader command for the reader.
template<typename Reader>
UndirEdgeSetReaderskipUndirEdgeMap (std::string name, const Reader &reader=Reader())
 Add a new undirected edge map skipper command for the reader.
template<typename Map>
UndirEdgeSetReaderreadEdgeMap (std::string name, Map &map)
 Add a new directed edge map reader command for the reader.
template<typename Reader, typename Map>
UndirEdgeSetReaderreadEdgeMap (std::string name, Map &map, const Reader &reader=Reader())
 Add a new directed edge map reader command for the reader.
template<typename Reader>
UndirEdgeSetReaderskipEdgeMap (std::string name, const Reader &reader=Reader())
 Add a new directed edge map skipper command for the reader.
bool isIdReader () const
 Returns true if the edgeset can give back the edge by its id.
void readId (std::istream &is, UndirEdge &undirEdge) const
 Gives back the undirected edge by its id.
void readId (std::istream &is, Edge &edge) const
 Gives back the directed edge by its id.

Protected Member Functions

virtual bool header (const std::string &line)
 Gives back true when the SectionReader can process the section with the given header line.
virtual void read (std::istream &is)
 Reader function of the section.


Constructor & Destructor Documentation

UndirEdgeSetReader LemonReader _reader,
typename SmartParameter< Graph >::Type  _graph,
const NodeIdReader &  _nodeIdReader,
const std::string _id = std::string(),
const DefaultSkipper _skipper = DefaultSkipper()
[inline]
 

Constructor for UndirEdgeSetReader. It creates the UndirEdgeSetReader and attach it into the given LemonReader. The undirected edgeset reader will add the readed undirected edges to the given Graph. It will use the given node id reader to read the source and target nodes of the edges. The reader will read the section only if the _id and the undiredgset_id are the same.

virtual ~UndirEdgeSetReader  )  [inline, virtual]
 

Destructor for UndirEdgeSetReader.


Member Function Documentation

UndirEdgeSetReader& readUndirEdgeMap std::string  name,
Map &  map
[inline]
 

Add a new edge undirected map reader command for the reader.

UndirEdgeSetReader& readUndirEdgeMap std::string  name,
Map &  map,
const Reader &  reader = Reader()
[inline]
 

Add a new edge undirected map reader command for the reader.

UndirEdgeSetReader& skipUndirEdgeMap std::string  name,
const Reader &  reader = Reader()
[inline]
 

Add a new undirected edge map skipper command for the reader.

UndirEdgeSetReader& readEdgeMap std::string  name,
Map &  map
[inline]
 

Add a new directed edge map reader command for the reader.

UndirEdgeSetReader& readEdgeMap std::string  name,
Map &  map,
const Reader &  reader = Reader()
[inline]
 

Add a new directed edge map reader command for the reader.

UndirEdgeSetReader& skipEdgeMap std::string  name,
const Reader &  reader = Reader()
[inline]
 

Add a new directed edge map skipper command for the reader.

virtual bool header const std::string line  )  [inline, protected, virtual]
 

It gives back true when the header line starts with @undiredgeset, and the header line's id and the edgeset's id are the same.

Implements LemonReader::SectionReader.

virtual void read std::istream is  )  [inline, protected, virtual]
 

It reads the content of the section.

Implements LemonReader::SectionReader.

bool isIdReader  )  const [inline]
 

Returns true if the edgeset can give back the undirected edge by its id. It is possible only if an "id" named map was read.

void readId std::istream is,
UndirEdge &  undirEdge
const [inline]
 

It reads an id from the stream and gives back which undirected edge belongs to it. It is possible only if there was read an "id" named map.

void readId std::istream is,
Edge &  edge
const [inline]
 

It reads an id from the stream and gives back which directed edge belongs to it. The directed edge id is the '+' or '-' character and the undirected edge id. It is possible only if there was read an "id" named map.


The documentation for this class was generated from the following file:
Generated on Sat Aug 27 14:15:44 2005 for LEMON by  doxygen 1.4.4