<div dir="ltr">I like this.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Aug 5, 2015 at 6:24 PM, Amos Jeffries <span dir="ltr"><<a href="mailto:squid3@treenet.co.nz" target="_blank">squid3@treenet.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Adds a PackableStream class which provides std::ostream semantics for<br>
writing data to a cachemgr report.<br>
<br>
FYI: This follows on from discussiosn back in 2011 regarding how to<br>
restructure the cachemgr internal data storage for relay between workers<br>
vs the report output formatting.<br>
<br>
Current trunk 'improved' code uses FooActionData classes to store and<br>
relay the report data internally, and classes implementing the Action<br>
API to format the report for delivery.<br>
<br>
<br>
For easy transition I have added an overload dump() method to the Action<br>
class API. New FooAction child classes should override the<br>
dump(ostream&) method instead of the StoreEntry one. Writing their data<br>
to the stream.<br>
<br>
Older actions overload the now-deprecated dump(StoreEntry*) method and<br>
use some complicate nested function calls or share helper functions in<br>
complex ways which make it hard to upgrade all at once. So for now the<br>
dump(StoreEntry*) is made a stub that calls dump(ostream&) if not<br>
overridden explicitly.<br>
<br>
The CacheManager class still uses dump(StoreEntry*) to get the reply<br>
payload from Action childs regardless of which dumper they implement.<br>
<br>
The basic report types are converted as part of this to be the first<br>
Actions using the stream output. The menu action in particular is<br>
slightly polished to benefit from stream abilities.<br>
<br>
<br>
Future steps along this path (in no particular order) are:<br>
* convert old Action classes to new API<br>
* refactor old C-code report generators to be Action classes<br>
 - fixing display output syntax to minimal YAML as we go on both the<br>
above. It mostly is already, but some reports have wrong syntax.<br>
* update Actions to be hidden from the menu display<br>
* update Actions to support menu name aliases<br>
* update Action API to receive client desired format<br>
<span class="HOEnZb"><font color="#888888"><br>
Amos<br>
<br>
</font></span><br>_______________________________________________<br>
squid-dev mailing list<br>
<a href="mailto:squid-dev@lists.squid-cache.org">squid-dev@lists.squid-cache.org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-dev" rel="noreferrer" target="_blank">http://lists.squid-cache.org/listinfo/squid-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">    Francesco</div>
</div>