COIN-OR::LEMON - Graph Library

Changeset 1396:56f9a4ba9149 in lemon-0.x for src/lemon/graph_writer.h


Ignore:
Timestamp:
04/28/05 11:54:38 (16 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1856
Message:

GUI section handling.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_writer.h

    r1394 r1396  
    155155  private:
    156156    bool escaped;
     157  };
     158
     159  class GUIWriter {
     160  public:
     161    virtual void write(std::ostream& os) = 0;
    157162  };
    158163
     
    239244    /// default skipper.
    240245    GraphWriter(std::ostream& _os, const Graph& _graph)
    241       : os(_os), graph(_graph) {}
     246      : gui_writer(0), os(_os), graph(_graph){}
    242247
    243248
     
    317322      edge_writers.push_back(make_pair(name, edge));
    318323      return *this;
     324    }
     325
     326    GraphWriter& writeGUI(const GUIWriter& writer) {
     327      gui_writer = &writer;
    319328    }
    320329
     
    329338      writeNodes(nodeWriter);
    330339      writeEdges(edgeWriter);
     340      writeGUI();
    331341      os << "@end" << std::endl;
    332342    }
     
    434444    }
    435445   
     446    void writeGUI() {     
     447      if (gui_writer) {
     448        os << "@gui" << std::endl;
     449        gui_writer->write(os);
     450      }
     451    }
    436452
    437453
     
    450466    typedef std::vector<std::pair<std::string, Edge> > EdgeWriters;
    451467    EdgeWriters edge_writers;
     468
     469    GUIWriter* gui_writer;
    452470
    453471    std::ostream& os;
Note: See TracChangeset for help on using the changeset viewer.