1.1 --- a/lemon/lgf_writer.h Fri Jul 04 16:12:31 2008 +0200
1.2 +++ b/lemon/lgf_writer.h Sat Jul 05 00:14:27 2008 +0200
1.3 @@ -18,7 +18,7 @@
1.4
1.5 ///\ingroup lemon_io
1.6 ///\file
1.7 -///\brief Lemon Graph Format writer.
1.8 +///\brief \ref lgf-format "Lemon Graph Format" writer.
1.9
1.10
1.11 #ifndef LEMON_LGF_WRITER_H
1.12 @@ -322,7 +322,7 @@
1.13
1.14 /// \ingroup lemon_io
1.15 ///
1.16 - /// \brief LGF writer for directed graphs
1.17 + /// \brief \ref lgf-format "LGF" writer for directed graphs
1.18 ///
1.19 /// This utility writes an \ref lgf-format "LGF" file.
1.20 ///
1.21 @@ -332,22 +332,22 @@
1.22 /// member function. A map writing rule can be added to the writer
1.23 /// with the \c nodeMap() or \c arcMap() members. An optional
1.24 /// converter parameter can also be added as a standard functor
1.25 - /// converting from the value type of the map to std::string. If it
1.26 - /// is set, it will determine how the map's value type is written to
1.27 + /// converting from the value type of the map to \c std::string. If it
1.28 + /// is set, it will determine how the value type of the map is written to
1.29 /// the output stream. If the functor is not set, then a default
1.30 /// conversion will be used. The \c attribute(), \c node() and \c
1.31 /// arc() functions are used to add attribute writing rules.
1.32 ///
1.33 ///\code
1.34 - /// DigraphWriter<Digraph>(std::cout, digraph).
1.35 - /// nodeMap("coordinates", coord_map).
1.36 - /// nodeMap("size", size).
1.37 - /// nodeMap("title", title).
1.38 - /// arcMap("capacity", cap_map).
1.39 - /// node("source", src).
1.40 - /// node("target", trg).
1.41 - /// attribute("caption", caption).
1.42 - /// run();
1.43 + /// DigraphWriter<Digraph>(std::cout, digraph).
1.44 + /// nodeMap("coordinates", coord_map).
1.45 + /// nodeMap("size", size).
1.46 + /// nodeMap("title", title).
1.47 + /// arcMap("capacity", cap_map).
1.48 + /// node("source", src).
1.49 + /// node("target", trg).
1.50 + /// attribute("caption", caption).
1.51 + /// run();
1.52 ///\endcode
1.53 ///
1.54 ///
1.55 @@ -486,9 +486,9 @@
1.56 /// \name Writing rules
1.57 /// @{
1.58
1.59 - /// \brief Node map reading rule
1.60 + /// \brief Node map writing rule
1.61 ///
1.62 - /// Add a node map reading rule to the writer.
1.63 + /// Add a node map writing rule to the writer.
1.64 template <typename Map>
1.65 DigraphWriter& nodeMap(const std::string& caption, const Map& map) {
1.66 checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
1.67 @@ -586,28 +586,28 @@
1.68 return *this;
1.69 }
1.70
1.71 - /// \name Select section by name
1.72 + /// \name Section captions
1.73 /// @{
1.74
1.75 - /// \brief Set \c \@nodes section to be read
1.76 + /// \brief Add an additional caption to the \c \@nodes section
1.77 ///
1.78 - /// Set \c \@nodes section to be read
1.79 + /// Add an additional caption to the \c \@nodes section.
1.80 DigraphWriter& nodes(const std::string& caption) {
1.81 _nodes_caption = caption;
1.82 return *this;
1.83 }
1.84
1.85 - /// \brief Set \c \@arcs section to be read
1.86 + /// \brief Add an additional caption to the \c \@arcs section
1.87 ///
1.88 - /// Set \c \@arcs section to be read
1.89 + /// Add an additional caption to the \c \@arcs section.
1.90 DigraphWriter& arcs(const std::string& caption) {
1.91 _arcs_caption = caption;
1.92 return *this;
1.93 }
1.94
1.95 - /// \brief Set \c \@attributes section to be read
1.96 + /// \brief Add an additional caption to the \c \@attributes section
1.97 ///
1.98 - /// Set \c \@attributes section to be read
1.99 + /// Add an additional caption to the \c \@attributes section.
1.100 DigraphWriter& attributes(const std::string& caption) {
1.101 _attributes_caption = caption;
1.102 return *this;
1.103 @@ -618,7 +618,7 @@
1.104
1.105 /// \brief Skip writing the node set
1.106 ///
1.107 - /// The \c \@nodes section will be not written to the stream.
1.108 + /// The \c \@nodes section will not be written to the stream.
1.109 DigraphWriter& skipNodes() {
1.110 LEMON_ASSERT(!_skip_nodes, "Multiple usage of skipNodes() member");
1.111 _skip_nodes = true;
1.112 @@ -627,7 +627,7 @@
1.113
1.114 /// \brief Skip writing arc set
1.115 ///
1.116 - /// The \c \@arcs section will be not written to the stream.
1.117 + /// The \c \@arcs section will not be written to the stream.
1.118 DigraphWriter& skipArcs() {
1.119 LEMON_ASSERT(!_skip_arcs, "Multiple usage of skipArcs() member");
1.120 _skip_arcs = true;
1.121 @@ -835,7 +835,7 @@
1.122
1.123 /// \brief Start the batch processing
1.124 ///
1.125 - /// This function starts the batch processing
1.126 + /// This function starts the batch processing.
1.127 void run() {
1.128 if (!_skip_nodes) {
1.129 writeNodes();
1.130 @@ -850,9 +850,9 @@
1.131 writeAttributes();
1.132 }
1.133
1.134 - /// \brief Gives back the stream of the writer
1.135 + /// \brief Give back the stream of the writer
1.136 ///
1.137 - /// Gives back the stream of the writer
1.138 + /// Give back the stream of the writer.
1.139 std::ostream& ostream() {
1.140 return *_os;
1.141 }
1.142 @@ -860,6 +860,9 @@
1.143 /// @}
1.144 };
1.145
1.146 + /// \brief Return a \ref DigraphWriter class
1.147 + ///
1.148 + /// This function just returns a \ref DigraphWriter class.
1.149 /// \relates DigraphWriter
1.150 template <typename Digraph>
1.151 DigraphWriter<Digraph> digraphWriter(std::ostream& os,
1.152 @@ -868,6 +871,9 @@
1.153 return tmp;
1.154 }
1.155
1.156 + /// \brief Return a \ref DigraphWriter class
1.157 + ///
1.158 + /// This function just returns a \ref DigraphWriter class.
1.159 /// \relates DigraphWriter
1.160 template <typename Digraph>
1.161 DigraphWriter<Digraph> digraphWriter(const std::string& fn,
1.162 @@ -876,6 +882,9 @@
1.163 return tmp;
1.164 }
1.165
1.166 + /// \brief Return a \ref DigraphWriter class
1.167 + ///
1.168 + /// This function just returns a \ref DigraphWriter class.
1.169 /// \relates DigraphWriter
1.170 template <typename Digraph>
1.171 DigraphWriter<Digraph> digraphWriter(const char* fn,
1.172 @@ -898,9 +907,13 @@
1.173
1.174 /// \ingroup lemon_io
1.175 ///
1.176 - /// \brief LGF writer for directed graphs
1.177 + /// \brief \ref lgf-format "LGF" writer for directed graphs
1.178 ///
1.179 /// This utility writes an \ref lgf-format "LGF" file.
1.180 + ///
1.181 + /// It can be used almost the same way as \c DigraphWriter.
1.182 + /// The only difference is that this class can handle edges and
1.183 + /// edge maps as well as arcs and arc maps.
1.184 template <typename _Graph>
1.185 class GraphWriter {
1.186 public:
1.187 @@ -1023,9 +1036,9 @@
1.188 /// \name Writing rules
1.189 /// @{
1.190
1.191 - /// \brief Node map reading rule
1.192 + /// \brief Node map writing rule
1.193 ///
1.194 - /// Add a node map reading rule to the writer.
1.195 + /// Add a node map writing rule to the writer.
1.196 template <typename Map>
1.197 GraphWriter& nodeMap(const std::string& caption, const Map& map) {
1.198 checkConcept<concepts::ReadMap<Node, typename Map::Value>, Map>();
1.199 @@ -1169,28 +1182,28 @@
1.200 return *this;
1.201 }
1.202
1.203 - /// \name Select section by name
1.204 + /// \name Section captions
1.205 /// @{
1.206
1.207 - /// \brief Set \c \@nodes section to be read
1.208 + /// \brief Add an additional caption to the \c \@nodes section
1.209 ///
1.210 - /// Set \c \@nodes section to be read
1.211 + /// Add an additional caption to the \c \@nodes section.
1.212 GraphWriter& nodes(const std::string& caption) {
1.213 _nodes_caption = caption;
1.214 return *this;
1.215 }
1.216
1.217 - /// \brief Set \c \@edges section to be read
1.218 + /// \brief Add an additional caption to the \c \@arcs section
1.219 ///
1.220 - /// Set \c \@edges section to be read
1.221 + /// Add an additional caption to the \c \@arcs section.
1.222 GraphWriter& edges(const std::string& caption) {
1.223 _edges_caption = caption;
1.224 return *this;
1.225 }
1.226
1.227 - /// \brief Set \c \@attributes section to be read
1.228 + /// \brief Add an additional caption to the \c \@attributes section
1.229 ///
1.230 - /// Set \c \@attributes section to be read
1.231 + /// Add an additional caption to the \c \@attributes section.
1.232 GraphWriter& attributes(const std::string& caption) {
1.233 _attributes_caption = caption;
1.234 return *this;
1.235 @@ -1201,7 +1214,7 @@
1.236
1.237 /// \brief Skip writing the node set
1.238 ///
1.239 - /// The \c \@nodes section will be not written to the stream.
1.240 + /// The \c \@nodes section will not be written to the stream.
1.241 GraphWriter& skipNodes() {
1.242 LEMON_ASSERT(!_skip_nodes, "Multiple usage of skipNodes() member");
1.243 _skip_nodes = true;
1.244 @@ -1210,7 +1223,7 @@
1.245
1.246 /// \brief Skip writing edge set
1.247 ///
1.248 - /// The \c \@edges section will be not written to the stream.
1.249 + /// The \c \@edges section will not be written to the stream.
1.250 GraphWriter& skipEdges() {
1.251 LEMON_ASSERT(!_skip_edges, "Multiple usage of skipEdges() member");
1.252 _skip_edges = true;
1.253 @@ -1418,7 +1431,7 @@
1.254
1.255 /// \brief Start the batch processing
1.256 ///
1.257 - /// This function starts the batch processing
1.258 + /// This function starts the batch processing.
1.259 void run() {
1.260 if (!_skip_nodes) {
1.261 writeNodes();
1.262 @@ -1433,9 +1446,9 @@
1.263 writeAttributes();
1.264 }
1.265
1.266 - /// \brief Gives back the stream of the writer
1.267 + /// \brief Give back the stream of the writer
1.268 ///
1.269 - /// Gives back the stream of the writer
1.270 + /// Give back the stream of the writer
1.271 std::ostream& ostream() {
1.272 return *_os;
1.273 }
1.274 @@ -1443,6 +1456,9 @@
1.275 /// @}
1.276 };
1.277
1.278 + /// \brief Return a \ref GraphWriter class
1.279 + ///
1.280 + /// This function just returns a \ref GraphWriter class.
1.281 /// \relates GraphWriter
1.282 template <typename Graph>
1.283 GraphWriter<Graph> graphWriter(std::ostream& os, const Graph& graph) {
1.284 @@ -1450,6 +1466,9 @@
1.285 return tmp;
1.286 }
1.287
1.288 + /// \brief Return a \ref GraphWriter class
1.289 + ///
1.290 + /// This function just returns a \ref GraphWriter class.
1.291 /// \relates GraphWriter
1.292 template <typename Graph>
1.293 GraphWriter<Graph> graphWriter(const std::string& fn, const Graph& graph) {
1.294 @@ -1457,6 +1476,9 @@
1.295 return tmp;
1.296 }
1.297
1.298 + /// \brief Return a \ref GraphWriter class
1.299 + ///
1.300 + /// This function just returns a \ref GraphWriter class.
1.301 /// \relates GraphWriter
1.302 template <typename Graph>
1.303 GraphWriter<Graph> graphWriter(const char* fn, const Graph& graph) {