doc/graph_io.dox
changeset 1527 7ceab500e1f6
parent 1526 8c14aa8f27a2
child 1532 aa7428d22aaf
equal deleted inserted replaced
5:938bb337b2a8 6:8a16f7282397
   204 
   204 
   205 \code
   205 \code
   206 reader.run();
   206 reader.run();
   207 \endcode
   207 \endcode
   208 
   208 
   209 \section types The background of Reading and Writing
   209 \section types Background of Reading and Writing
   210 The \c GraphReader should know how to read a Value from the given map.
   210 To read a map (on the nodes or edges)
       
   211 the \c GraphReader should know how to read a Value from the given map.
   211 By the default implementation the input operator reads a value from
   212 By the default implementation the input operator reads a value from
   212 the stream and the type of the readed value is the value type of the given map.
   213 the stream and the type of the readed value is the value type of the given map.
   213 When the reader should skip a value in the stream, because you do not
   214 When the reader should skip a value in the stream, because you do not
   214 want to store it in map, the reader skips a character sequence without 
   215 want to store it in a map, the reader skips a character sequence without 
   215 whitespace. 
   216 whitespace. 
   216 
   217 
   217 If you want to change the functionality of the reader, you can use
   218 If you want to change the functionality of the reader, you can use
   218 template parameters to specialize it. When you give a reading
   219 template parameters to specialize it. When you give a reading
   219 command for a map you can give a Reader type as template parameter.
   220 command for a map you can give a Reader type as template parameter.
   227 
   228 
   228   void read(std::istream& is, Value& value);
   229   void read(std::istream& is, Value& value);
   229 };
   230 };
   230 \endcode
   231 \endcode
   231 
   232 
   232 By example, the \c "strings" nodemap contains strings and you do not need
   233 For example, the \c "strings" nodemap contains strings and you do not need
   233 the value of the string just the length. Then you can implement own Reader
   234 the value of the string just the length. Then you can implement own Reader
   234 struct.
   235 struct.
   235 
   236 
   236 \code
   237 \code
   237 struct LengthReader {
   238 struct LengthReader {
   251 special template parameter to the GraphReader class. By default, the
   252 special template parameter to the GraphReader class. By default, the
   252 template parameter is \c DefaultReaderTraits. A reader traits class 
   253 template parameter is \c DefaultReaderTraits. A reader traits class 
   253 should provide an inner template class Reader for each type, and an 
   254 should provide an inner template class Reader for each type, and an 
   254 DefaultReader for skipping a value.
   255 DefaultReader for skipping a value.
   255 
   256 
   256 The specialization of the writing should be very similar to the reading.
   257 The specialization of  writing should be very similar to that of reading.
   257 
   258 
   258 \author Balazs Dezso
   259 \author Balazs Dezso
   259 */
   260 */
   260 }
   261 }