@bpnodeset
bpnodeset_name
, but the bpnodeset_name
may be empty.
The first line of the section contains "&anodeset"
and the the names of the A-node maps and regular maps separated with white spaces. Each next lines describes an A-node in the anodeset, and contains the mapped values for each map. If one of the line starts with "&bnodeset"
then this line contains the names of the B-node maps and the regular node maps. And the remaining lines contains the mapped values to the B-nodes.
If there is "label" named map then it should be defined in both nodeset, and 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. #include <lemon/lemon_reader.h>
Public Member Functions | |
BpNodeSetReader (LemonReader &_reader, Graph &_graph, const std::string &_name=std::string(), const DefaultSkipper &_skipper=DefaultSkipper()) | |
Constructor. | |
virtual | ~BpNodeSetReader () |
Destructor. | |
template<typename Map > | |
BpNodeSetReader & | readNodeMap (std::string label, Map &map) |
template<typename ItemReader , typename Map > | |
BpNodeSetReader & | readNodeMap (std::string label, Map &map, const ItemReader &ir=ItemReader()) |
template<typename Map > | |
BpNodeSetReader & | readANodeMap (std::string label, Map &map) |
template<typename ItemReader , typename Map > | |
BpNodeSetReader & | readANodeMap (std::string label, Map &map, const ItemReader &ir=ItemReader()) |
template<typename Map > | |
BpNodeSetReader & | readBNodeMap (std::string label, Map &map) |
template<typename ItemReader , typename Map > | |
BpNodeSetReader & | readBNodeMap (std::string label, Map &map, const ItemReader &ir=ItemReader()) |
template<typename ItemReader > | |
BpNodeSetReader & | skipNodeMap (std::string label, const ItemReader &ir=ItemReader()) |
template<typename ItemReader > | |
BpNodeSetReader & | skipANodeMap (std::string label, const ItemReader &ir=ItemReader()) |
template<typename ItemReader > | |
BpNodeSetReader & | skipBNodeMap (std::string label, const ItemReader &ir=ItemReader()) |
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. |
BpNodeSetReader | ( | LemonReader & | _reader, | |
Graph & | _graph, | |||
const std::string & | _name = std::string() , |
|||
const DefaultSkipper & | _skipper = DefaultSkipper() | |||
) | [inline] |
Constructor for BpNodeSetReader. It creates the BpNodeSetReader and attach it into the given LemonReader. The nodeset reader will add the read nodes to the given Graph. The reader will read the section when the section_name
and the _name
are the same.
virtual ~BpNodeSetReader | ( | ) | [inline, virtual] |
Destructor for BpNodeSetReader.
BpNodeSetReader& readNodeMap | ( | std::string | label, | |
Map & | map | |||
) | [inline] |
Add a new node map reader command for the reader.
BpNodeSetReader& readNodeMap | ( | std::string | label, | |
Map & | map, | |||
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new node map reader command for the reader.
BpNodeSetReader& readANodeMap | ( | std::string | label, | |
Map & | map | |||
) | [inline] |
Add a new A-node map reader command for the reader.
BpNodeSetReader& readANodeMap | ( | std::string | label, | |
Map & | map, | |||
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new A-node map reader command for the reader.
BpNodeSetReader& readBNodeMap | ( | std::string | label, | |
Map & | map | |||
) | [inline] |
Add a new B-node map reader command for the reader.
BpNodeSetReader& readBNodeMap | ( | std::string | label, | |
Map & | map, | |||
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new B-node map reader command for the reader.
BpNodeSetReader& skipNodeMap | ( | std::string | label, | |
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new node map skipper command for the reader.
BpNodeSetReader& skipANodeMap | ( | std::string | label, | |
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new A-node map skipper command for the reader.
BpNodeSetReader& skipBNodeMap | ( | std::string | label, | |
const ItemReader & | ir = ItemReader() | |||
) | [inline] |
Add a new B-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 SectionReader.
virtual void read | ( | std::istream & | is | ) | [inline, protected, virtual] |
It reads the content of the section.
Implements 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.