lemon/graph_writer.h
changeset 2388 c6d537888fe5
parent 2200 2f2ac1b1ca1e
child 2391 14a343be7a5a
equal deleted inserted replaced
12:f8e46a97c40c 13:8ad6eca74dbd
   156 
   156 
   157     /// \brief Issue a new node map writing command for the writer.
   157     /// \brief Issue a new node map writing command for the writer.
   158     ///
   158     ///
   159    /// This function issues a new <i> node map writing command</i> to the writer.
   159    /// This function issues a new <i> node map writing command</i> to the writer.
   160     template <typename Map>
   160     template <typename Map>
   161     GraphWriter& writeNodeMap(std::string name, const Map& map) {
   161     GraphWriter& writeNodeMap(std::string label, const Map& map) {
   162       nodeset_writer.writeNodeMap(name, map);
   162       nodeset_writer.writeNodeMap(label, map);
   163       return *this;
   163       return *this;
   164     }
   164     }
   165 
   165 
   166 
   166 
   167     /// \brief Issue a new node map writing command for the writer.
   167     /// \brief Issue a new node map writing command for the writer.
   168     ///
   168     ///
   169    /// This function issues a new <i> node map writing command</i> to the writer.
   169    /// This function issues a new <i> node map writing command</i> to the writer.
   170     template <typename Writer, typename Map>
   170     template <typename ItemWriter, typename Map>
   171     GraphWriter& writeNodeMap(std::string name, const Map& map, 
   171     GraphWriter& writeNodeMap(std::string label, const Map& map, 
   172 			      const Writer& writer = Writer()) {
   172 			      const ItemWriter& iw = ItemWriter()) {
   173       nodeset_writer.writeNodeMap(name, map, writer);
   173       nodeset_writer.writeNodeMap(label, map, iw);
   174       return *this;
   174       return *this;
   175     }
   175     }
   176 
   176 
   177 
   177 
   178     /// \brief Issue a new edge map writing command for the writer.
   178     /// \brief Issue a new edge map writing command for the writer.
   179     ///
   179     ///
   180    /// This function issues a new <i> edge map writing command</i> to the writer.
   180    /// This function issues a new <i> edge map writing command</i> to the writer.
   181     template <typename Map>
   181     template <typename Map>
   182     GraphWriter& writeEdgeMap(std::string name, const Map& map) { 
   182     GraphWriter& writeEdgeMap(std::string label, const Map& map) { 
   183       edgeset_writer.writeEdgeMap(name, map);
   183       edgeset_writer.writeEdgeMap(label, map);
   184       return *this;
   184       return *this;
   185     }
   185     }
   186 
   186 
   187 
   187 
   188     /// \brief Issue a new edge map writing command for the writer.
   188     /// \brief Issue a new edge map writing command for the writer.
   189     ///
   189     ///
   190    /// This function issues a new <i> edge map writing command</i> to the writer.
   190    /// This function issues a new <i> edge map writing command</i> to the writer.
   191     template <typename Writer, typename Map>
   191     template <typename ItemWriter, typename Map>
   192     GraphWriter& writeEdgeMap(std::string name, const Map& map,
   192     GraphWriter& writeEdgeMap(std::string label, const Map& map,
   193 			      const Writer& writer = Writer()) {
   193 			      const ItemWriter& iw = ItemWriter()) {
   194       edgeset_writer.writeEdgeMap(name, map, writer);
   194       edgeset_writer.writeEdgeMap(label, map, iw);
   195       return *this;
   195       return *this;
   196     }
   196     }
   197 
   197 
   198     /// \brief Issue a new labeled node writing command to the writer.
   198     /// \brief Issue a new labeled node writing command to the writer.
   199     ///
   199     ///
   200     /// This function issues a new <i> labeled node writing command</i> 
   200     /// This function issues a new <i> labeled node writing command</i> 
   201     /// to the writer.
   201     /// to the writer.
   202     GraphWriter& writeNode(std::string name, const Node& node) {
   202     GraphWriter& writeNode(std::string label, const Node& node) {
   203       node_writer.writeNode(name, node);
   203       node_writer.writeNode(label, node);
   204       return *this;
   204       return *this;
   205     }
   205     }
   206 
   206 
   207     /// \brief Issue a new labeled edge writing command to the writer.
   207     /// \brief Issue a new labeled edge writing command to the writer.
   208     ///
   208     ///
   209     /// This function issues a new <i> labeled edge writing command</i> 
   209     /// This function issues a new <i> labeled edge writing command</i> 
   210     /// to the writer.
   210     /// to the writer.
   211     GraphWriter& writeEdge(std::string name, const Edge& edge) {
   211     GraphWriter& writeEdge(std::string label, const Edge& edge) {
   212       edge_writer.writeEdge(name, edge);
   212       edge_writer.writeEdge(label, edge);
   213     }
   213     }
   214 
   214 
   215     /// \brief Issue a new attribute writing command.
   215     /// \brief Issue a new attribute writing command.
   216     ///
   216     ///
   217     /// This function issues a new <i> attribute writing command</i> 
   217     /// This function issues a new <i> attribute writing command</i> 
   218     /// to the writer.
   218     /// to the writer.
   219     template <typename Value>
   219     template <typename Value>
   220     GraphWriter& writeAttribute(std::string name, const Value& value) {
   220     GraphWriter& writeAttribute(std::string label, const Value& value) {
   221       attribute_writer.writeAttribute(name, value);
   221       attribute_writer.writeAttribute(label, value);
   222       return *this;
   222       return *this;
   223     }
   223     }
   224     
   224     
   225     /// \brief Issue a new attribute writing command.
   225     /// \brief Issue a new attribute writing command.
   226     ///
   226     ///
   227     /// This function issues a new <i> attribute writing command</i> 
   227     /// This function issues a new <i> attribute writing command</i> 
   228     /// to the writer.
   228     /// to the writer.
   229     template <typename Writer, typename Value>
   229     template <typename ItemWriter, typename Value>
   230     GraphWriter& writeAttribute(std::string name, const Value& value, 
   230     GraphWriter& writeAttribute(std::string label, const Value& value, 
   231 			       const Writer& writer) {
   231 			       const ItemWriter& iw = ItemWriter()) {
   232       attribute_writer.writeAttribute<Writer>(name, value, writer);
   232       attribute_writer.writeAttribute(label, value, iw);
   233       return *this;
   233       return *this;
   234     }
   234     }
   235 
   235 
   236     /// \brief Conversion operator to LemonWriter.
   236     /// \brief Conversion operator to LemonWriter.
   237     ///
   237     ///
   410     /// \brief Issue a new node map writing command to the writer.
   410     /// \brief Issue a new node map writing command to the writer.
   411     ///
   411     ///
   412     /// This function issues a new <i> node map writing command</i> to
   412     /// This function issues a new <i> node map writing command</i> to
   413     /// the writer.
   413     /// the writer.
   414     template <typename Map>
   414     template <typename Map>
   415     UGraphWriter& writeNodeMap(std::string name, const Map& map) {
   415     UGraphWriter& writeNodeMap(std::string label, const Map& map) {
   416       nodeset_writer.writeNodeMap(name, map);
   416       nodeset_writer.writeNodeMap(label, map);
   417       return *this;
   417       return *this;
   418     }
   418     }
   419 
   419 
   420     /// \brief Issue a new node map writing command to the writer.
   420     /// \brief Issue a new node map writing command to the writer.
   421     ///
   421     ///
   422     /// This function issues a new <i> node map writing command</i> to
   422     /// This function issues a new <i> node map writing command</i> to
   423     /// the writer.
   423     /// the writer.
   424     template <typename Writer, typename Map>
   424     template <typename ItemWriter, typename Map>
   425     UGraphWriter& writeNodeMap(std::string name, const Map& map, 
   425     UGraphWriter& writeNodeMap(std::string label, const Map& map, 
   426 			      const Writer& writer = Writer()) {
   426 			      const ItemWriter& iw = ItemWriter()) {
   427       nodeset_writer.writeNodeMap(name, map, writer);
   427       nodeset_writer.writeNodeMap(label, map, iw);
   428       return *this;
   428       return *this;
   429     }
   429     }
   430 
   430 
   431     /// \brief Issue a new edge map writing command to the writer.
   431     /// \brief Issue a new edge map writing command to the writer.
   432     ///
   432     ///
   433     /// This function issues a new <i> edge map writing command</i> to
   433     /// This function issues a new <i> edge map writing command</i> to
   434     /// the writer.
   434     /// the writer.
   435     template <typename Map>
   435     template <typename Map>
   436     UGraphWriter& writeEdgeMap(std::string name, const Map& map) { 
   436     UGraphWriter& writeEdgeMap(std::string label, const Map& map) { 
   437       u_edgeset_writer.writeEdgeMap(name, map);
   437       u_edgeset_writer.writeEdgeMap(label, map);
   438       return *this;
   438       return *this;
   439     }
   439     }
   440 
   440 
   441     /// \brief Issue a new edge map writing command to the writer.
   441     /// \brief Issue a new edge map writing command to the writer.
   442     ///
   442     ///
   443     /// This function issues a new <i> edge map writing command</i> to
   443     /// This function issues a new <i> edge map writing command</i> to
   444     /// the writer.
   444     /// the writer.
   445     template <typename Writer, typename Map>
   445     template <typename ItemWriter, typename Map>
   446     UGraphWriter& writeEdgeMap(std::string name, const Map& map,
   446     UGraphWriter& writeEdgeMap(std::string label, const Map& map,
   447 				   const Writer& writer = Writer()) {
   447 				   const ItemWriter& iw = ItemWriter()) {
   448       u_edgeset_writer.writeEdgeMap(name, map, writer);
   448       u_edgeset_writer.writeEdgeMap(label, map, iw);
   449       return *this;
   449       return *this;
   450     }
   450     }
   451 
   451 
   452     /// \brief Issue a new undirected edge map writing command to the writer.
   452     /// \brief Issue a new undirected edge map writing command to the writer.
   453     ///
   453     ///
   454     /// This function issues a new <i> undirected edge map writing
   454     /// This function issues a new <i> undirected edge map writing
   455     /// command</i> to the writer.
   455     /// command</i> to the writer.
   456     template <typename Map>
   456     template <typename Map>
   457     UGraphWriter& writeUEdgeMap(std::string name, const Map& map) { 
   457     UGraphWriter& writeUEdgeMap(std::string label, const Map& map) { 
   458       u_edgeset_writer.writeUEdgeMap(name, map);
   458       u_edgeset_writer.writeUEdgeMap(label, map);
   459       return *this;
   459       return *this;
   460     }
   460     }
   461 
   461 
   462     /// \brief Issue a new undirected edge map writing command to the writer.
   462     /// \brief Issue a new undirected edge map writing command to the writer.
   463     ///
   463     ///
   464     /// This function issues a new <i> undirected edge map writing
   464     /// This function issues a new <i> undirected edge map writing
   465     /// command</i> to the writer.
   465     /// command</i> to the writer.
   466    template <typename Writer, typename Map>
   466    template <typename ItemWriter, typename Map>
   467     UGraphWriter& writeUEdgeMap(std::string name, const Map& map,
   467     UGraphWriter& writeUEdgeMap(std::string label, const Map& map,
   468 					const Writer& writer = Writer()) {
   468 					const ItemWriter& iw = ItemWriter()) {
   469       u_edgeset_writer.writeUEdgeMap(name, map, writer);
   469       u_edgeset_writer.writeUEdgeMap(label, map, iw);
   470       return *this;
   470       return *this;
   471     }
   471     }
   472 
   472 
   473     /// \brief Issue a new labeled node writer to the writer.
   473     /// \brief Issue a new labeled node writer to the writer.
   474     ///
   474     ///
   475     /// This function issues a new <i> labeled node writing
   475     /// This function issues a new <i> labeled node writing
   476     /// command</i> to the writer.
   476     /// command</i> to the writer.
   477     UGraphWriter& writeNode(std::string name, const Node& node) {
   477     UGraphWriter& writeNode(std::string label, const Node& node) {
   478       node_writer.writeNode(name, node);
   478       node_writer.writeNode(label, node);
   479       return *this;
   479       return *this;
   480     }
   480     }
   481 
   481 
   482     /// \brief Issue a new labeled edge writer to the writer.
   482     /// \brief Issue a new labeled edge writer to the writer.
   483     ///
   483     ///
   484     /// This function issues a new <i> labeled edge writing
   484     /// This function issues a new <i> labeled edge writing
   485     /// command</i> to the writer.
   485     /// command</i> to the writer.
   486     UGraphWriter& writeEdge(std::string name, const Edge& edge) {
   486     UGraphWriter& writeEdge(std::string label, const Edge& edge) {
   487       u_edge_writer.writeEdge(name, edge);
   487       u_edge_writer.writeEdge(label, edge);
   488     }
   488     }
   489 
   489 
   490     /// \brief Issue a new labeled undirected edge writing command to
   490     /// \brief Issue a new labeled undirected edge writing command to
   491     /// the writer.
   491     /// the writer.
   492     ///
   492     ///
   493     /// Issue a new <i>labeled undirected edge writing command</i> to
   493     /// Issue a new <i>labeled undirected edge writing command</i> to
   494     /// the writer.
   494     /// the writer.
   495     UGraphWriter& writeUEdge(std::string name, const UEdge& edge) {
   495     UGraphWriter& writeUEdge(std::string label, const UEdge& edge) {
   496       u_edge_writer.writeUEdge(name, edge);
   496       u_edge_writer.writeUEdge(label, edge);
   497     }
   497     }
   498 
   498 
   499     /// \brief Issue a new attribute writing command.
   499     /// \brief Issue a new attribute writing command.
   500     ///
   500     ///
   501     /// This function issues a new <i> attribute writing
   501     /// This function issues a new <i> attribute writing
   502     /// command</i> to the writer.
   502     /// command</i> to the writer.
   503     template <typename Value>
   503     template <typename Value>
   504     UGraphWriter& writeAttribute(std::string name, const Value& value) {
   504     UGraphWriter& writeAttribute(std::string label, const Value& value) {
   505       attribute_writer.writeAttribute(name, value);
   505       attribute_writer.writeAttribute(label, value);
   506       return *this;
   506       return *this;
   507     }
   507     }
   508     
   508     
   509     /// \brief Issue a new attribute writing command.
   509     /// \brief Issue a new attribute writing command.
   510     ///
   510     ///
   511     /// This function issues a new <i> attribute writing
   511     /// This function issues a new <i> attribute writing
   512     /// command</i> to the writer.
   512     /// command</i> to the writer.
   513     template <typename Writer, typename Value>
   513     template <typename ItemWriter, typename Value>
   514     UGraphWriter& writeAttribute(std::string name, const Value& value, 
   514     UGraphWriter& writeAttribute(std::string label, const Value& value, 
   515 			       const Writer& writer) {
   515 			       const ItemWriter& iw = ItemWriter()) {
   516       attribute_writer.writeAttribute<Writer>(name, value, writer);
   516       attribute_writer.writeAttribute(label, value, iw);
   517       return *this;
   517       return *this;
   518     }
   518     }
   519 
   519 
   520     /// \brief Conversion operator to LemonWriter.
   520     /// \brief Conversion operator to LemonWriter.
   521     ///
   521     ///