diff -r f67737f5727a -r e15162d8eca1 doc/graph_io.dox --- a/doc/graph_io.dox Tue Aug 16 16:44:57 2005 +0000 +++ b/doc/graph_io.dox Tue Aug 16 19:06:59 2005 +0000 @@ -122,7 +122,8 @@ \subsection write Writing a graph -The \c GraphWriter class provides the graph output. To write a graph +The \ref lemon::GraphWriter "GraphWriter" template class +provides the graph output. To write a graph you should first give writing commands to the writer. You can declare writing command as \c NodeMap or \c EdgeMap writing and labeled Node and Edge writing. @@ -131,8 +132,10 @@ GraphWriter writer(std::cout, graph); \endcode -The \c writeNodeMap() function declares a \c NodeMap writing command in the -\c GraphWriter. You should give a name to the map and the map +The \ref lemon::GraphWriter::writeNodeMap() "writeNodeMap()" +function declares a \c NodeMap writing command in the +\ref lemon::GraphWriter "GraphWriter". +You should give a name to the map and the map object as parameters. The NodeMap writing command with name "id" should write a unique map because it will be regarded as an ID map. @@ -147,7 +150,8 @@ writer.writeNodeMap("color", colorMap); \endcode -With the \c writeEdgeMap() member function you can give an edge map +With the \ref lemon::GraphWriter::writeEdgeMap() "writeEdgeMap()" +member function you can give an edge map writing command similar to the NodeMaps. \see IdMap, DescriptorMap @@ -160,7 +164,9 @@ writer.writeEdgeMap("label", labelMap); \endcode -With \c writeNode() and \c writeEdge() functions you can designate Nodes and +With \ref lemon::GraphWriter::writeNode() "writeNode()" +and \ref lemon::GraphWriter::writeEdge() "writeEdge()" +functions you can designate Nodes and Edges in the graph. For example, you can write out the source and target node of a maximum flow instance. @@ -171,14 +177,16 @@ writer.writeEdge("observed", edge); \endcode -With \c writeAttribute() function you can write an attribute to the file. +With \ref lemon::GraphWriter::writeAttribute() "writeAttribute()" +function you can write an attribute to the file. \code writer.writeAttribute("author", "Balazs DEZSO"); writer.writeAttribute("version", 12); \endcode -After you give all write commands you must call the \c run() member +After you give all write commands you must call the +\ref lemon::GraphWriter::run() "run()" member function, which executes all the writing commands. \code @@ -189,8 +197,10 @@ The file to be read may contain several maps and labeled nodes or edges. If you read a graph you need not read all the maps and items just those -that you need. The interface of the \c GraphReader is very similar to -the GraphWriter but the reading method does not depend on the order of the +that you need. The interface of the \ref lemon::GraphReader "GraphReader" +is very similar to +the \ref lemon::GraphWriter "GraphWriter" +but the reading method does not depend on the order of the given commands. The reader object assumes that each not readed value does not contain @@ -201,10 +211,12 @@ GraphReader reader(std::cin, graph); \endcode -The \c readNodeMap() function reads a map from the \c nodeset section. +The \ref lemon::GraphReader::readNodeMap() "readNodeMap()" +function reads a map from the \c nodeset section. If there is a map that you do not want to read from the file and there are whitespaces in the string represenation of the values then you should -call the \c skipNodeMap() template member function with proper parameters. +call the \ref lemon::GraphReader::skipNodeMap() "skipNodeMap()" +template member function with proper parameters. \see QuotedStringReader @@ -218,7 +230,8 @@ reader.readNodeMap("color", colorMap); \endcode -With the \c readEdgeMap() member function you can give an edge map +With the \ref lemon::GraphReader::readEdgeMap() "readEdgeMap()" +member function you can give an edge map reading command similar to the NodeMaps. \code @@ -226,7 +239,9 @@ reader.readEdgeMap("label", labelMap); \endcode -With \c readNode() and \c readEdge() functions you can read labeled Nodes and +With \ref lemon::GraphReader::readNode() "readNode()" +and \ref lemon::GraphReader::readEdge() "readEdge()" +functions you can read labeled Nodes and Edges. \code @@ -236,7 +251,8 @@ reader.readEdge("observed", edge); \endcode -With \c readAttribute() function you can read an attribute from the file. +With \ref lemon::GraphReader::readAttribute() "readAttribute()" +function you can read an attribute from the file. \code std::string author; @@ -245,7 +261,8 @@ writer.writeAttribute("version", version); \endcode -After you give all read commands you must call the \c run() member +After you give all read commands you must call the +\ref lemon::GraphReader::run() "run()" member function, which executes all the commands. \code @@ -257,7 +274,8 @@ To read a map (on the nodes or edges) -the \c GraphReader should know how to read a Value from the given map. +the \ref lemon::GraphReader "GraphReader" +should know how to read a Value from the given map. By the default implementation the input operator reads a value from the stream and the type of the readed value is the value type of the given map. When the reader should skip a value in the stream, because you do not @@ -337,12 +355,16 @@ -back 5 \endcode -There are similar classes to the \c GraphReader ans \c GraphWriter -which handle the undirected graphs. These classes are the -\c UndirGraphReader and \UndirGraphWriter. +There are similar classes to the \ref lemon::GraphReader "GraphReader" and +\ref lemon::GraphWriter "GraphWriter" which +handle the undirected graphs. These classes are +the \ref lemon::UndirGraphReader "UndirGraphReader" +and \ref lemon::UndirGraphWriter "UndirGraphWriter". -The \c readUndirMap() function reads an undirected map and the -\c readUndirEdge() reads an undirected edge from the file, +The \ref lemon::UndirGraphReader::readUndirMap() "readUndirMap()" +function reads an undirected map and the +\ref lemon::UndirGraphReader::readUndirEdge() "readUndirEdge()" +reads an undirected edge from the file, \code reader.readUndirEdgeMap("capacity", capacityMap); @@ -364,15 +386,20 @@ The content of the section this way cannot contain line with \c \@ first character. The file may contains comment lines with \c # first character. -The \c LemonReader and \c LemonWriter gives a framework to read and +The \ref lemon::LemonReader "LemonReader" +and \ref lemon::LemonWriter "LemonWriter" +gives a framework to read and write sections. There are various section reader and section writer -classes which can be attached to a \c LemonReader or a \c LemonWriter. +classes which can be attached to a \ref lemon::LemonReader "LemonReader" +or a \ref lemon::LemonWriter "LemonWriter". There are default section readers and writers for reading and writing item sets, and labeled items in the graph. These read and write the format described above. Other type of data can be handled with own section reader and writer classes which are inherited from the -\c LemonReader::SectionReader or the \c LemonWriter::SectionWriter classes. +\c LemonReader::SectionReader or the +\ref lemon::LemonWriter::SectionWriter "LemonWriter::SectionWriter" +classes. The next example defines a special section reader which reads the \c \@description sections into a string: @@ -414,8 +441,8 @@ In our example there is a network with symmetric links and there are assymetric traffic request on the network. This construction can be stored in an -undirected graph and in a directed NewEdgeSetAdaptor class. The example -shows the input with the LemonReader class: +undirected graph and in a directed \c NewEdgeSetAdaptor class. The example +shows the input with the \ref lemon::LemonReader "LemonReader" class: \code UndirListGraph network; @@ -433,9 +460,12 @@ reader.run(); \endcode -Because the GraphReader and the UndirGraphReader can be converted -to LemonReader and it can resolve the ID's of the items, the previous -result can be achived with the UndirGraphReader class, too. +Because both the \ref lemon::GraphReader "GraphReader" +and the \ref lemon::UndirGraphReader "UndirGraphReader" can be converted +to \ref lemon::LemonReader "LemonReader" +and it can resolve the ID's of the items, the previous +result can be achived with the \ref lemon::UndirGraphReader "UndirGraphReader" +class, too. \code @@ -454,4 +484,4 @@ \author Balazs Dezso */ -} +} \ No newline at end of file