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

EdgeSetReader Class Template Reference
[Input Output]

#include <lemon/lemon_reader.h>

Inherits CommonSectionReaderBase.

Inheritance diagram for EdgeSetReader:

Inheritance graph
[legend]
List of all members.

Detailed Description

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

The lemon format can store multiple graph edgesets with several maps. The edgeset section's header line is @edgeset edgeset_id, but the edgeset_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 source and the target nodes' id and the mapped values for each map.

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 edge which is mapped to this value.

The 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>
 EdgeSetReader (LemonReader &_reader, typename SmartParameter< Graph >::Type _graph, const NodeIdReader &_nodeIdReader, const std::string &_id=std::string(), const DefaultSkipper &_skipper=DefaultSkipper())
 Constructor.
virtual ~EdgeSetReader ()
 Destructor.
template<typename Map>
EdgeSetReaderreadEdgeMap (std::string name, Map &map)
 Add a new edge map reader command for the reader.
template<typename Reader, typename Map>
EdgeSetReaderreadEdgeMap (std::string name, Map &map, const Reader &reader=Reader())
 Add a new edge map reader command for the reader.
template<typename Reader>
EdgeSetReaderskipEdgeMap (std::string name, const Reader &reader=Reader())
 Add a new 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, Edge &edge) const
 Gives back the 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

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

Constructor for EdgeSetReader. It creates the EdgeSetReader and attach it into the given LemonReader. The edgeset reader will add the readed 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 edgset_id are the same.

virtual ~EdgeSetReader  )  [inline, virtual]
 

Destructor for EdgeSetReader.


Member Function Documentation

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

Add a new edge map reader command for the reader.

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

Add a new edge map reader command for the reader.

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

Add a new 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 @edgeset, 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 edge by its id. It is possible only if an "id" named map was read.

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

It reads an id from the stream and gives back which edge belongs to it. 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:43 2005 for LEMON by  doxygen 1.4.4