[FlopCpp-tickets] Re: [FlopC++] #10: Alter the method for
generation of the "display()" methods
FlopC++
coin-trac at coin-or.org
Fri Jul 21 23:11:25 EDT 2006
#10: Alter the method for generation of the "display()" methods
-------------------------+--------------------------------------------------
Reporter: hpwalton | Owner: hpwalton
Type: enhancement | Status: new
Priority: low | Milestone:
Component: component1 | Version:
Severity: normal | Resolution:
Keywords: |
-------------------------+--------------------------------------------------
Old description:
> Motivation: It is not always desirable to see output to the screen. The
> display methods always use cout.
>
> Proposal:
> create a toString() method for all the public interface classes. These
> would print whatever information is attached and valid at the time of
> invocation. Note that some data may not be completely attached yet. In
> those cases it should report as such.
> Calling toString() on the Model should cascade.
>
> Bonus points:
> Create a toMathML() method such that if the user wishes to get a browser
> render-able version of the formulation.
>
> Note: no need to interrupt the display() methods. They can leverage
> toString() to generate the text.
> Note: Also add "Named" as a base class to many other classes. This
> allows for more "human readable" debugging.
New description:
Motivation: It is not always desirable to see output to the screen. The
display methods always use cout.
Proposal:
create a toString() method for all the public interface classes. These
would print whatever information is attached and valid at the time of
invocation. Note that some data may not be completely attached yet. In
those cases it should report as such.
Calling toString() on the Model should cascade.
Bonus points:
Create a toMathML() method such that if the user wishes to get a browser
render-able version of the formulation.
Note: no need to interrupt the display() methods. They can leverage
toString() to generate the text.
Note: Also add "Named" as a base class to many other classes. This allows
for more "human readable" debugging.
Note: With many items as "Named" subclasses, and having "Named" as the
"owner" of the toString() method, it should be relatively easy to produce
left shift operators into an ostream for convenience of printing (e.g.
std::ostream &operator<<(std::ostream &os, const MP_model &model); will
allow a call like:
MP_model model;
...
cout<<model<<std::endl;
--
Ticket URL: <https://projects.coin-or.org/FlopC++/ticket/10>
FlopC++ <http://example.com/>
My example project
More information about the FlopCpp-tickets
mailing list