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