NodeSetReader Class Template Reference
[Input Output]

#include <lemon/lemon_reader.h>

Inherits LemonReader::SectionReader.

Inheritance diagram for NodeSetReader:

Inheritance graph
[legend]
List of all members.

Detailed Description

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

The lemon format can store multiple graph nodesets with several maps. The nodeset section's header line is @nodeset nodeset_name, but the nodeset_name may be empty.

The first line of the section contains the names of the maps separated with white spaces. Each next lines describes a node in the nodeset, and contains the mapped values for each map.

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


Public Member Functions

 NodeSetReader (LemonReader &_reader, Graph &_graph, const std::string &_name=std::string(), const DefaultSkipper &_skipper=DefaultSkipper())
 Constructor.
virtual ~NodeSetReader ()
 Destructor.
template<typename Map>
NodeSetReaderreadNodeMap (std::string name, Map &map)
 Add a new node map reader command for the reader.
template<typename Reader, typename Map>
NodeSetReaderreadNodeMap (std::string name, Map &map, const Reader &reader=Reader())
 Add a new node map reader command for the reader.
template<typename Reader>
NodeSetReaderskipNodeMap (std::string name, const Reader &reader=Reader())
 Add a new node map skipper command for the reader.
bool isLabelReader () const
 Returns true if the nodeset can give back the node by its label.
void readLabel (std::istream &is, Node &node) const
 Gives back the node by its label.

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

NodeSetReader LemonReader _reader,
Graph &  _graph,
const std::string &  _name = std::string(),
const DefaultSkipper _skipper = DefaultSkipper()
[inline]
 

Constructor for NodeSetReader. It creates the NodeSetReader and attach it into the given LemonReader. The nodeset reader will add the readed nodes to the given Graph. The reader will read the section when the section_name and the _name are the same.

virtual ~NodeSetReader  )  [inline, virtual]
 

Destructor for NodeSetReader.


Member Function Documentation

NodeSetReader& readNodeMap std::string  name,
Map &  map
[inline]
 

Add a new node map reader command for the reader.

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

Add a new node map reader command for the reader.

NodeSetReader& skipNodeMap std::string  name,
const Reader &  reader = Reader()
[inline]
 

Add a new node 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 @nodeset, and the header line's name and the nodeset's name 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 isLabelReader  )  const [inline]
 

Returns true if the nodeset can give back the node by its label. It is possible only if an "label" named map was read.

void readLabel std::istream &  is,
Node &  node
const [inline]
 

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


The documentation for this class was generated from the following file:
Generated on Fri Feb 3 18:41:52 2006 for LEMON by  doxygen 1.4.6